Closed

Facebook API script

This project was awarded to PrajwalShetty for $90 USD.

Get free quotes for a project like this
Employer working
Awarded to:
Skills Required
Project Budget
$30 - $250 USD
Total Bids
6
Project Description

I need a script using Facebook API

PART 1

I need 2 text boxes where I can enter the and coordinates.

Combine the following 3 queries into 1 batch request to the facebook graph API:

/search?q=club&type=place&center=,&distance=50000&fields=id&limit=1000
/search?q=nightclub&type=place&center=,&distance=50000&fields=id&limit=1000
/search?q=bar&type=place&center=,&distance=50000&fields=id&limit=1000

Refer to [url removed, login to view] for information on the Graph API search function
Refer to [url removed, login to view] for information on batching

Combine the results from the batch request and remove any duplicates to create $place_list

Take $place_list and use it in the following query using facebook FQL Query:

SELECT categories, fan_count, location, name, page_id, pic FROM page WHERE page_id IN ($place_list) ORDER BY fan_count DESC

Refer to [url removed, login to view] for information on using Facebook FQL Query
Refer to [url removed, login to view] for information on the page table

Take results from the above query and remove any results that do not have any of the following [url removed, login to view]: club, night club, dance club, bar

Take the first 100 results to create $place_list_100

Display the results

PART 2

Use $place_list_100 and use the name field of each result for the following queries:

/search?q=&type=event&limit=100
/search?q=&type=event&limit=100
/search?q=&type=event&limit=100
...
/search?q=&type=event&limit=100

Combine the above queries into batch requests. Facebook only allows a maximun of 50 queries for each batch request so you will need to make 2 batch requests. One

batch request will use the first 50 names in $place_list_100 and the second batch request will use the 51-100 names in $place_list_100.

Combine the results and filter only events whose location field is an exact match of any one of the names in $location_list_100 and whose start_time field is

within the next 30 days and create a list of just the eid field to create $event_list

Use $event_list and use it in the following query using facebook FQL Query:

SELECT attending_count, eid, location, name, description, pic, pic_square, start_time, venue FROM event WHERE eid IN ($event_list) ORDER BY attending_count DESC

Refer to [url removed, login to view] for information on the event table

Display the results

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online