Foursquare API Getting friends checkin History - php

So I've created an app on foursquare and used this tutorial to get the user to accept my application for their FourSquare account.
Now I was under the impression after I did this I would be able to access their checkin history. I've tried pulling their USER_ID and used this $friend = $fsObj->get('/users/USER_ID_HERE'); to get the users information. But when I access their checkins $friend->response->user->checkins I only see their latest and most recent checkin. Yet their count is greater then one.
I am assuming there is something messed up with them not being an authorized user of my app yet in their profile->settings it shows them that their account is attached to my app.
Any help would be greatly appreciated on how to access their checkin history! Thanks! :)

At the moment the API will only return venue history for the authenticated use (user logged in).
https://developer.foursquare.com/docs/users/venuehistory.html
I am also hoping to be able to see top visited venues by user at some point soon. Foursq folk, any eta on when we'd be able to get at least a top 10 from any friended user of the authenticated profile?

To access the authorized user's checkin history, you need the /users/USER_ID/checkins endpoint. The /users endpoint it appears you're using only shows one checkin that's used by the native apps to populate the "last seen at" information.
https://developer.foursquare.com/docs/users/checkins.html

Related

App-scoped IDs in Facebook group members request

I am the administrator of a Facebook group, and I created a site where I use FB login to identify my users; users of the site are supposed to be also members of my FB group.
Before the introduction of version 2.0 of Facebook API I used to store the ID of people logging in through my app in a mySql DB; since API 2.0 app-scoped ID have been created (https://developers.facebook.com/docs/apps/upgrading#), and I've understood how they work.
I've noticed that users who have logged in after the introduction of 2.0 API have the (longer) app-scoped ID, while old ones are keeping the same old ID (as I expected).
Now my question: I'm writing a small code to check if members of FB group I administrate are users of my site too (i.e. if their IDs have already been stored in my site's database), but I've found that a lot of IDs obtained through this code:
$members = $facebook->api('/'.$userGroupId.'/members','GET');
foreach($members['data'] as $data) {
echo $data["id"]."<br>"; }
are different from the ones I've stored in my DB.
The same user seems to be identified with 2 different IDs, one for login and another one for the group.
So, what's going on?
I suppose is something related to app-scoped IDs, but so far I haven't found a clear explaination on how FB group members IDs work...
Hope that someone could help me to better understand the logic behind user IDs on Facebook groups.

LinkedIn API get other user's information

I'm developing an application that uses the LinkedIn API (and other social networks') to retrieve the messages you receive in yout timeline and get other user's information.
I know that I can't get that information over a user since the last API update thay made, but I'd like to know if that's possible from a company page. I can get the updates I've made on the page and my user profile but what I want is to get the user's profile from a person that makes a like in one of my publications (to put and example).
Is that possible like with the Facebook API and Twitter API or I can only access to information from the user that is authenticated in the application?
Thank you.
In general, only You can get that information with authenticated users in the application.
As for LinkedIn, I don't know if you know that from May 12 (if I remember correctly) LinkedIn API is changed.
Changes in Linkedin API

Integrating Your Facebook Event to Your Website Without Creating Facebook Application - Possible?

I was wondering if it's possible to integrating your facebook event into your own website?
and without creating a facebook application (means, you dont have app id, secret etc - you only have eventid/eid)
and what i'm trying to achieve is:
my event is a private event means only invited people can see the event details
and I want to list/parse the event wall post, and show it in my website
is it possible to put attend/maybe/not attend action on my website (any hint/example - much appreciate)
i want to show/list photo of my events as well
so the application flow more or less would be like this:
once the user come to the site, I'll check
if the user logged-in into facebook then
if user invited to the event then
full access to the site
return;
else
access denied (sort of)
end if
else
show facebook login form / ask the user to login into their facebook account
end if
is that possible? and what is the effective way to achieve it? should i create FB application?
Thanks in Advance
You need a Facebook Application
You should grant the user_events,offline_access permissions and save your event ID and access token somewhere (this would answer your second point of listing event's wall post)
Now that you are able to list your event's data, users should authorize and grant your application the create_event permission.
Then refer to this answer to check how to rsvp a user (access_token here is the user's access token not the one you got from offline_access)
Please note that I don't guaranty the result of the above depending on your event privacy setting, so the best thing to do is test it.

Facebook PHP SDK - Get user name and profile picture of my app users without requiring facebook connect

First of all, thanks in advance for reading. I've already posted this question in the facebook forums but after a couple of hours I'm not getting any responses.
I've got this app where an user can choose a piece (like in a puzzle). After the user picks a piece, he is redirected to the facebook authorize page and then returned to the app, then I save the user ID and his chosen piece in the database. At this point I've got everything alright... but the problem comes when...
If anyone see the app, he should be able to see the pieces and the PIECES OWNER INFO (name and profile picture).
The problem is if the user has not allowed the app yet (facebook authorization page), I can't use the facebook API to get the users who have already allowed the app (because I need an access token and the access token is given only to users who has authorized the app).
So, in short:
I need: get name and profile picture of users who have already authorized the app, without authenticating all users.
P.S: I was trying the "Authenticating as an App" option with PHP+libCURL but didn't work (or I did it the wrong way).
P.S2: Sorry if I have writing mistakes, my speaking language is spanish.
Thanks again... A LOT!!!!
No authentication nor breach of TOS required if you have the IDs, as profile pic and name are public information
Proof?? Right Here in this JSON.

Creating a leaderboard using Facebook APIs and the PHP SDK

I'm a new Facebook developer. I'm creating a game and want to include a leader board.
I'd like to build a fairly detailed leader board including the following information:
1) Name
2) Pic_Square or profile_pic
3) A general location (UK, USA or LONDON, NY)
4) Score
I'm aware of how to get a current users basic information from the either the old REST API or the Graph API. However from what I understand of the Facebook rules I can't store the information I want to use from the API.
This leads me to the conclusion I should be polling the Facebook API using the information I can store (FB user ID's). When querying the API for specific user ID's (the ones for the test users I have generated) API methods (user.getInfo and fql.query) return either just the ID of the user or the fields I have requested with null values.
When querying my own ID I can access all the data.
Are there any methods to obtain publicly available data via the any of the APIs?
Thanks for your help!
Ben
Why do you think that you can't store this info? On the user table page it even says:
You can cache this data and subscribe to real time updates on any of its fields which are also fields in the corresponding Graph API version.
If you request offline_access permission you would be able to get user information even when a user is not currently logged in to your app.
You should be able to get any user public info without permissions or access token by going to:
https://graph.facebook.com/<USER_ID>
To display avatar you can use this code:
<img src="https://graph.facebook.com/<USER_ID>/picture"/>
I don't think you would be able to get location without requesting extra permissions.

Categories