Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:46:49+00:00 2026-06-15T18:46:49+00:00

I need to count the Facebook Likes, Google +1’s, Diggs, Stumbles from StumpleUpon, and

  • 0

I need to count the Facebook Likes, Google +1’s, Diggs, Stumbles from StumpleUpon, and Tweets given for a particular URL in a Rails 3 application.

Is there any tutorial or API or demo in Rails?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:46:50+00:00Added an answer on June 15, 2026 at 6:46 pm

    For facebook likes count, google +1 count

    I write following helper to find the count depending on url

      #Ref:- http://developers.facebook.com/docs/reference/plugins/like/
      def facebook_like_count(url, id)
        js = <<-JAVASCRIPT
          <div id="#{id}">
            <img src='/images/facebook_login.png'/>
          </div>
          <script>
            jQuery(window).load(function() {
              var query = FB.Data.query('select like_count from link_stat where url="#{url}"');
              query.wait(function(rows){
                jQuery("##{id}").append((typeof(rows[0]) === "undefined") ? "<br/>0" : "<br/>"+rows[0].like_count)
              });
            });
          </script>
          JAVASCRIPT
          js.html_safe
      end
    
      def tweets_count(url, id)
        js = <<-JAVASCRIPT
          <div id="#{id}">
            <img src="/images/share-twitter.png" />
          </div>
          <script>
            jQuery(window).load(function() {
              jQuery.getJSON('http://feeds.delicious.com/v2/json/urlinfo/data?url='+"#{url}"+'&amp;callback=?',
                function(data) {
                  jQuery('##{id}').append((typeof(data[0]) === "undefined") ? "<br/>0" : "<br/>"+data[0].total_posts);
              });
            });
          </script>
          JAVASCRIPT
          js.html_safe
      end
    
      #Ref:- https://developers.google.com/+/plugins/+1button/#plusonetag-parameters
      def google_plus_one_count(url, id)
        js = <<-JAVASCRIPT
          <div id="#{id}">
            <g:plusone href="#{url}" annotation="bubble"></g:plusone>
          </div>
          <script type="text/javascript">
            jQuery(window).load(function() {
            window.___gcfg = {
              lang: 'en-US'
            };
    
            (function() {
              var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
              po.src = 'https://apis.google.com/js/plusone.js';
              var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
            })();
            });
          </script>
          JAVASCRIPT
          js.html_safe
      end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to fetch facebook likes,share, comments count from an article Is there any
I need to align the Facebook likes count box to the bottom of my
I need to count all distinct values from table LDS where status = 'ok'
I need to retrieve the number of fans for a given Facebook application. Using
I need to count the number of excel files,pdf files from a directory. I
I need to search Facebook for certain keywords and count them if possible? Thanks!
I have integrated Facebook Like into my website.Now i need to get/list the count
I need to count the length of an Ajax response done in jQuery. The
I need to count all elements who has id like 'hi*'. For example, if
I need to count number of repeating and position where they repeat of all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.