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 6051007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:45:14+00:00 2026-05-23T07:45:14+00:00

Came across the Contacts plugin while searching. But as per the usage, described in

  • 0

Came across the Contacts plugin while searching.

But as per the usage, described in the readme file. It requires username and password to fetch contacts. But that’s not a good approach.

  • 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-05-23T07:45:15+00:00Added an answer on May 23, 2026 at 7:45 am

    Mini FB plugin for Facebook login. It also allows me to fetch users contacts. So I can use this one for Facebook. Koala is another solution for fetching facebook friends

    FACEBOOK UPDATE

    Here i got the solution for facebook, but i it just show me invite friends for facebook

        <div id="facebook_invites" class="conclusion" style="width: 750px; text-align: center">
          <a id="wall_post" href="#" style="font-size: 2em;">Post on your Wall</a><br/>
          <a id="invite_friends" href="#" style="font-size: 1.5em;">Invite your Friends</a>
          </div>
            <div id="fb-root"></div>
    
    
          <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
            <script type="text/javascript">
              $('#wall_post').click(function() {
                FB.init({
                  appId:'app_id', cookie:true,
                  status:true, xfbml:true
                });
    
                FB.ui({ method: 'feed',
                  link: 'http://localhost:3000/',
                  picture: 'http://localhost:3000/',
                  description: 'abc is cool.',
                  name: 'abc.com'});
              });
    
              $('#invite_friends').click(function() {
                FB.init({
                  appId:'app_id', cookie:true,
                  status:true, xfbml:true
                });
    
                FB.ui({ method: 'apprequests',
                  message: 'abc is cool.'});
              });
            </script>
    


    Google Update

    From google developers guide, we have a section “Retrieving all contacts”, But in between there is a line written ie:-

    Note: Retrieving another user’s contacts is not supported by the current version of the Contacts API.

       /*
        * Retrieve all contacts
        */
    
        // Create the contacts service object
        var contactsService =
           new google.gdata.contacts.ContactsService('GoogleInc-jsguide-1.0');
    
        // The feed URI that is used for retrieving contacts
        var feedUri = 'http://www.google.com/m8/feeds/contacts/default/full';
        var query = new google.gdata.contacts.ContactQuery(feedUri);
    
        // Set the maximum of the result set to be 50
        query.setMaxResults(50);
    
        // callback method to be invoked when getContactFeed() returns data
        var callback = function(result) {
    
         // An array of contact entries
         var entries = result.feed.entry;
    
         // Iterate through the array of contact entries
         for (var i = 0; i < entries.length; i++) {
           var contactEntry = entries[i];
    
           var emailAddresses = contactEntry.getEmailAddresses();
    
           // Iterate through the array of emails belonging to a single contact entry
           for (var j = 0; j < emailAddresses.length; j++) {
             var emailAddress = emailAddresses[j].getAddress();
             PRINT('email = ' + emailAddress);
           }    
         }
        }
    
        // Error handler
        var handleError = function(error) {
         PRINT(error);
        }
    
        // Submit the request using the contacts service object
        contactsService.getContactFeed(query, callback, handleError);
    

    Another sever side solution for google contacts:
    Solution for google:

    Get your client_id and client_secret from here. This is rough script, which works perfectly fine. Modified it as per your needs.

        require 'net/http'
        require 'net/https'
        require 'uri'
        require 'rexml/document'
    
        class ImportController < ApplicationController
    
          def authenticate
            @title = "Google Authetication"
    
            client_id = "xxxxxxxxxxxxxx.apps.googleusercontent.com"
            google_root_url = "https://accounts.google.com/o/oauth2/auth?state=profile&redirect_uri="+googleauth_url+"&response_type=code&client_id="+client_id.to_s+"&approval_prompt=force&scope=https://www.google.com/m8/feeds/"
            redirect_to google_root_url
          end
    
          def authorise
            begin
              @title = "Google Authetication"
              token = params[:code]
              client_id = "xxxxxxxxxxxxxx.apps.googleusercontent.com"
              client_secret = "xxxxxxxxxxxxxx"
              uri = URI('https://accounts.google.com/o/oauth2/token')
              http = Net::HTTP.new(uri.host, uri.port)
              http.use_ssl = true
              http.verify_mode = OpenSSL::SSL::VERIFY_NONE
              request = Net::HTTP::Post.new(uri.request_uri)
    
              request.set_form_data('code' => token, 'client_id' => client_id, 'client_secret' => client_secret, 'redirect_uri' => googleauth_url, 'grant_type' => 'authorization_code')
              request.content_type = 'application/x-www-form-urlencoded'
              response = http.request(request)
              response.code
              access_keys = ActiveSupport::JSON.decode(response.body)
    
              uri = URI.parse("https://www.google.com/m8/feeds/contacts/default/full?oauth_token="+access_keys['access_token'].to_s+"&max-results=50000&alt=json")
    
              http = Net::HTTP.new(uri.host, uri.port)
              http.use_ssl = true
              http.verify_mode = OpenSSL::SSL::VERIFY_NONE
              request = Net::HTTP::Get.new(uri.request_uri)
              response = http.request(request)
              contacts = ActiveSupport::JSON.decode(response.body)
              contacts['feed']['entry'].each_with_index do |contact,index|
    
                 name = contact['title']['$t']
                 contact['gd$email'].to_a.each do |email|
                  email_address = email['address']
                  Invite.create(:full_name => name, :email => email_address, :invite_source => "Gmail", :user_id => current_user.id)  # for testing i m pushing it into database..
                end
    
              end  
            rescue Exception => ex
               ex.message
            end
            redirect_to root_path , :notice => "Invite or follow your Google contacts."
    
    
          end
    
        end
    

    Screenshot for settings.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across this class while reading a C# book and have some questions.
Recently I came across a recommendation for a Visual Studio plugin called Refactor! For
I came across this kind of situation but could not resolve, any hint would
I came across them, but I have yet to see why I should use
Came across the term pigeon computing while reading about how google works.. Can someone
I came across the following while reading about how easy it is to redefine
I came across this pretty cool wizard menu, but I can't figure out how
Came across something strange while migrating to my new server. I have a script
Came across this one while browsing the response to another question on SO (
Came across this error today. Wondering if anyone can tell me what it means:

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.