If I create a facebook like button with data-href = "www.ohohohoho.com"
and ... some people like it.
How can I know if my logged user likes it with the SDK or Graph or FDK ? I saw that I can only retrieve the kind of
referenced page with :
https://stackoverflow.com/questions/11671094/retrieve-non-facebook-liked-pages-from-a-facebook-user
by doing :
https://graph.facebook.com/?ids=http://www.imdb.com/title/tt0117500/
But the rest not :(
Thank you
You cant get users that liked it. But you can know if determined user liked this.
Related
I know how to create a "Follow me" button on Twitter, but I only want to display it if the user is not already following me. Is there a way to do this properly?
You can get a list of your own followers' ids using this endpoint: https://dev.twitter.com/docs/api/1/get/followers/ids
If you know their twitter handle, you can get the id of someone using your app using this endpoint: https://dev.twitter.com/docs/api/1/get/users/lookup
Then your button display code will look something like:
if ([arrayOfFollowerIds containsObject:idOfAppUser]){
followButton.hidden = YES;
}
I am looking at old posts to try and figure out what's wrong with the hackbook example at https://github.com/facebook/facebook-ios-sdk/tree/master/sample/Hackbook .
In this post, Post image to facebook using graph api , it seems that his problem was 117795728310/photos" instead of me/photos
What does 117795728310 refer to? I'm assuming it's not his app id. If it's his user id, where can I find out what mine is?
Thanks,
Mich
The paths of the open graph usually start with the id of the object and then it's connections.
For example: 6708787004/feed will return the feed for the South Park page.
The id can be replaced with a "username", so the above example is the same as "southpark/feed".
And "me/feed" is the same as "YOUR_USER_ID/feed"
You can get your id in all kind of ways, it will be easier to just check "/me" in the graph explorer.
The id you posted is not of a user but a page (graph explorer)
It does look like a User ID.
Go to http://www.facebook.com/note.php?note_id=91532827198 to see how you get yours
Twitter users can login and post comments on my site, as well as new posts.
Now, i am storing the user ID on my comments table on the database.
I was wondering what is the best practice to get users avatar and show it anywhere.
I guess that using the API is not the best option as it has a rate limit of 150/hour or 350/hour if OAuth is used.
Then i thought about getting it with this little code:
<?php
$username = "twitter"; // <-- You did not use quotes here?! Typo?
$xml = simplexml_load_file("http://twitter.com/users/".$username.".xml");
echo $xml->profile_image_url; // <-- No $xml->user here!
?>
But if i have to show, let's say, 20 avatars on one same page, maybe there will be a little delay getting all of them.
I also thought about storing them on the database on a users table with the nick and so on. But then... what if the user updates his profile picture? I would still having the old one...
So, what is the best practice for it?
There are many pages and systems with have to deal with same problems such as pinterest.com, or liveFyre comment system, disqus...
Thanks
I would say that you need to store the avatar URL generated by twitter and use that without calling the API everytime. Or use this service http://tweetimag.es/
I have successfully posted now. I have successfully set the privacy params and they work fine. Next, I would like to be able to add people tags like you can do in the Facebook website, where it adds to your message such as: with Bill Smith and Joe Blow. I've read the documentation on Post's. There it includes an item called message_tags, but that seems to refer to a location in the message. So, I created a message on the FB website on my wall where I added a couple of friends and the message has the 'with x and y' on the screen. Then, in my app, I downloaded my posts to see what they looked like in the logging view. No message_tags, but two other places, 'to' and 'with_tags' have the friends there. So, I modified my posting code to use each of these and even tried using both. They post with no error, but viewing on the FB website, no mention of the friends.
When I download these posts using my app, no mention of 'to' or 'message_tags' or 'with_tags'.
Any help would be appreciated.
In addition, I have tried to specify a place in the params. I used data taken from a post which I created on the FB website and downloaded into my app, so the data should be valid. Here is the JSON:
place = "{\"id\":\"171321908789\",\"name\":\"City O City\",\"location\":{\"street\":\"206 E. 13th Ave.\",\"longitude\":\"-104.9845\",\"latitude\":\"39.7367\",\"zip\":\"80203\"}}";
When I include this for key: place, I get this:
0 : {contents = "message"} = {contents = "(#100) {"id":"171321908789","name":"City O City","location":{"street":"206 E. 13th Ave.","longitude":"-104.9845","latitude":"39.7367","zip":"80203"}} does not resolve to a valid user ID"}
To post
Hi -- in PLACE with FRIEND1 and FRIEND2
you only need the ids of the place and friends. Try the following parameters :
message : "Hi",
place : "PLACE-id",
tags : "FRIEND1-id, FRIEND2-id"
It works for me in the graph explorer (
http://developers.facebook.com/tools/explorer) with the publish_actions permissions, when I post to https://graph.facebook.com/ME-id/feed
Hope it helps some people and is not too late for you.
A.
I have Aouth working for Twitter, and pulling in a stream of tweets, I am trying to figure out how to then Favorite one of the Tweets coming in from the stream.
I understand twitter's API give me this:
Parameters:
* id. Optional. The ID or screen name of the user for whom to request a list of favorite statuses.
o Example: http://api.twitter.com/1/favorites/bob.json or http://api.twitter.com/1/favorites/bob.rss
* page. Optional. Specifies the page of favorites to retrieve.
o Example: http://api.twitter.com/1/favorites.xml?page=3
But that doesn't really help me in trying to implement, or I just am not sure how to approach it
Any help ?
POST favorites/create on twitter development site
Did you try this?
function Like(ScreenName, TweetID)
{
client.rest.post('favorites/create', { screen_name: ScreenName, id: TweetID});
}
Something like this in JavaScript.