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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:47:29+00:00 2026-06-17T12:47:29+00:00

Hello I use the following code in order to retrieve an events infoormation from

  • 0

Hello I use the following code in order to retrieve an events infoormation from facebook based on the url provided.

The code is this:

function importEvent($url) 
{
    $facebook = new Facebook(array(
          'appId'  => 'someAppId',
          'secret' => 'someSecret',
          'cookie' => true, // enable optional cookie support
        )); 

    if(checkLogin()==true)
    {   
        //get rid of hash if exists
        $hash = explode('#',$url);

        if(!empty($hash[1]))
            $array = parse_url($hash[1]);
        else
            $array = parse_url($hash[0]);

        parse_str($array['query'],$output);
        $eid = $output['eid'];

        if(empty($eid))//new url think http://www.facebook.com/events/2323423423423/
        {
            $url = str_replace('http://www.facebook.com/events/','',$url);
            $url = str_replace('https://www.facebook.com/events/','',$url);
            $hash = explode('/?',$url);

            if(!empty($hash[1]))
                $url = $hash[0];

            $eid =   str_replace('?','',$url);  
            $eid =   str_replace('/','',$url);
            //print_r($eid);
        }
            //Calling users.getinfo legacy api call example
            try{
                $param  =   array(
                    'method'  => 'events.get',
                    'eids'    => $eid,
                    'access_token' => $_SESSION['access_token']

                );
                $events   =   $facebook->api($param);
            }
            catch(Exception $o){
                error_log($o);
                echo $o; 
            }

        print_r($events);   
        return $events;
    }
}

The output I’m getting is this:

Array
(
    [0] => Array
        (
            [eid] => 410474065693887
            [name] => Sunday Night Fever Vol.4  Disco Special @Legacy Rock Area
            [pic_small] => http://profile.ak.fbcdn.net/hprofile-ak-snc6/276862_410474065693887_714884848_t.jpg
            [pic_big] => http://profile.ak.fbcdn.net/hprofile-ak-snc6/276862_410474065693887_714884848_n.jpg
            [pic] => http://profile.ak.fbcdn.net/hprofile-ak-snc6/276862_410474065693887_714884848_s.jpg
            [pic_square] => http://profile.ak.fbcdn.net/hprofile-ak-snc6/276862_410474065693887_714884848_q.jpg
            [has_profile_pic] => 1
            [host] => Legacy Rock Area
            [version] => 2
            [description] => Αφου μας το ζητησατε "παρτε" το..!!!

Μετα το τελευταιο απιστευτο killer Disco Party εχουμε την ευκαιρια να κανουμε προθερμανση για τον Super Αποκριατικο Φεβρουαριο που θα ακολουθησει στο Legacy Rock Area μεμια βραδυα γεματη Disco,Dance,Pop και οπου μας βγαλει...!!

Κυριακη 20 Ιανουαριου λοιπον..Sunday Night Fever Disco Special!!!

That night the DJ saves our lives...!!!
            [start_time] => 2013-01-20
            [end_time] => 
            [timezone] => 
            [is_date_only] => 1
            [creator] => 1732432279
            [update_time] => 1357737066
            [location] => Legacy Rock Area
            [hide_guest_list] => 
            [can_invite_friends] => 
            [privacy] => OPEN
            [venue] => Array
                (
                    [id] => 244479685665743
                )

            [all_members_count] => 7175
            [attending_count] => 74
            [unsure_count] => 144
            [declined_count] => 509
            [not_replied_count] => 6957
        )

)

However on the api documentation it mentions that venue contains the following:

The location of this event
generic access_token, user_events or friends_events
object containing one or more of the following fields: id, street, city, state, zip, country, latitude, and longitude fields.

But all I’m getting is the venue id.

I couldn’t locate a specific piece of information on how to retrieve lat + lng of a venue place and I assume that this code is ok if I’m not mistaken.

Do I need to execute another query just for the venue info and if so could you please provide any reference or code examples? Or is there a way for this piece of code to return the lat + lng also, so I wont have to do 2 queries for 1 event?

  • 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-17T12:47:31+00:00Added an answer on June 17, 2026 at 12:47 pm

    After some research I’ve found that that this could be doen with fql.multiquery and it seems to work fine now. Here is the source code.

    function importEventFQL($url)
    {
        $facebook = new Facebook(array(
              'appId'  => 'someApddID',
              'secret' => 'someSecret',
              'cookie' => true, // enable optional cookie support
            )); 
    
        if(checkLogin()==true)
        {   
    
            list($url_static,$url_URI) = explode('/events',$url);
    
            $url_URI = ltrim($url_URI,'/');
            list($eid, $trash) = explode('/?',$url_URI);
    
            $fql = '{';
    
            $fql .= '"event_info":"SELECT name, description, pic_small, pic_big, eid, venue, location, start_time, end_time, host from event WHERE eid=\'' . $eid . '\'",';
            $fql .= '"event_venue":"SELECT name, username, page_id, location FROM page WHERE page_id IN (SELECT venue.id FROM #event_info)"';
    
            $fql .= '}';
    
            $param = array(
                'method'   => 'fql.multiquery',
                'queries'  => $fql,
                'callback' => ''
            );
    
            $result = $facebook->api($param);
    
            print_r($result);
        }   
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to use the following code to retrieve the data from the
hello I have this code that use to sort a datatable. Dim sortingIndex As
The following code does not output hello world I do not want to use
Hello Sir i want send list of data to php server i use following
In Bash, I can use the following code: [ $sshcmd = ] && sshcmd=ssh
I am new to EJB 3 . I use the following code to start
I can't figure out why the following code doesn't behave as expected Hello/You/There.replaceAll(/, \\/);
I have the following code which I use to map a nested list in
Hello I have the following code. using System; using System.Collections.Generic; using System.Linq; using System.Text;
I have the following code: use strict; my $org_file_hash = { 'S6' => '/path/to/file/filename.txt_S6',

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.