Show tagged images from facebook on website? - facebook

I am trying to achieve similar functionality to the one shown here...http://blackmilkclothing.com/collections/leggings/products/circuit-board-grey-leggings
there fan page https://www.facebook.com/blackmilkclothing allows people to hash tag a photo and then populate it on their website like the link above.
Loading a series of tagged images from my facebook fan page to my website. I am not positive how this is acheived? I am assuming some kind of api process but any help in the right direction would be appreciated.
Thanks! All help is appreciated

See the 'tagged' connection of a Page in the Graph API: https://developers.facebook.com/docs/reference/api/page/
It returns a list of objects the page is tagged in, including photos
If you need background knowledge I suggest these links in particular:
Graph API overview: https://developers.facebook.com/docs/reference/api/
Page login: https://developers.facebook.com/docs/authentication/pages/

After a good bit of trial and error I've found the most efficient way to query photos tagged to a particular Facebook page is to use Facebook's FQL interface to retrieve a list of stream posts.
With FQL you can limit the queried objects to only those posts containing images (unlike with the higher-level Graph API calls which will return all posts, many of which may not have associated photos), and you'll also have more granular control over composition of the result set.
Keep in mind that Facebook doesn't have true hashtag support (only Facebook pages can be tagged), so to simulate the hashtag support that Black Milk Clothing encourages, you'll need to parse and filter the photo message text yourself.
As an alternative quick and easy solution, I've rolled the results of my efforts into a free online service called TagTray -- with TagTray I've added an interface for building and curating hashtag based galleries from Facebook, Instagram, and TwitPic (including application-level Facebook hashtag filtering) that can be framelessly embedded into a site with a few lines of JavaScript.

Related

How can I get a list of all "likable" Facebook pages?

I'm exploring the Facebook API for the first time - partially to research a web app idea I have and partially out of pure curiosity. The Explorer tool has been a great help with most things.
I'm trying to get a complete list of "Likable" pages on Facebook such as: Movies, Music, Books, TV Shows, etc. I understand how to get a list of pages that a user has liked, but I want the entire index of pages that exist.
All of the strings I've worked with so far start with /username. Is there another prefix for querying Facebook in general?
No, this is not possible and doesn't exist in the API.
A query like this is way too resource intensive.
You can use the
/search?q={query}&type=page&access_token={app_access_token}
with {query} as the search string, {app_access_token} as your App Access Token, as outlined at
https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#search
It's not possible to retrieve or search for whole Page Categories.

How to get all user's likes using facebook's graph API

How can I query facebook's graph API to retrieve all user's likes (not only pages but also photos and others)?
For instance, how could I get all the pictures a user has liked? Using facebook's search bar you can find them easily by clicking on "photos has liked".
I wrote a script that scrapes the page content and does that but it's not very efficient.
I have recently come accross a similar problem, maybe this helps you solve it.
https://graph.facebook.com/v2.5/{page_id}/feed?fields=likes.limit(1).summary(true)&since={start_date}&until={end_date}&access_token={access_token}
This will give you a list of all posts that received likes during the specified time period. If you manage to write a code summing up the following JSON path you got your sum for "all user's likes":
data[0].likes.summary.total_count
Not entirely sure is this is exactly what you were searching for, hope it helps you though - and if not you, someone else.
As for likes you can also use the same way to extract Shares and Comments:
Shares
https://graph.facebook.com/v2.5/{page_id}/feed?fields=shares&since={start_date}&until={end_date}&access_token=
Comments
https://graph.facebook.com/v2.5/{page_id}/feed?fields=comments.limit(1).summary(true)&since={start_date}&until={end_date}&access_token=
Best regards
There isn't to my knowledge any way to get this from the API without grabbing every type of response from the API and then sorting through for likes. Facebook search bar uses an internal API different from the Graph API.

"Top Posts" depending on facebook likes

I have an idea to create a "top posts" feature to my website, which creates the "top" list depending on how many likes and shares that a post have on facebook.
Users may see how many likes an post has received so far since they only have to ask for a single, defined url. However, the website itself has to be able to query all the links that are tied to itself (which have a predefined url template like website.com/[post-id]) to create the "top" list. Is it possible to do something similar (or achieve the same result in a different way)?
Any ideas on a real workflow about something like this will be appreciated!
this seems like a little but interesting project. I don't know if there is a feature that could get that directly in the way you want, but i did something similar.
First you have the Graph API, with that you can get the Posts of a user using feed, with that every post is telling you how many likes does it have which you can get with POST_ID/likes.
Then you'll have to check for changes in the post periodically comparing its created_time and updated_time.
This could seem very hard, because you have a lot of posts and you have to check them all for updates, but you can use batch_requests so you can check them all at once.
I have made a bookmarklet which shows top posts in the Facebook News Feed as well as Google+, Twitter and Instagram Profiles.
Just add a new bookmark in your bookmarks bar and replace its URL with the following code and save it, then go to the social network website and run it:
javascript:(function(){var s=document.createElement('script');s.src='https://niutech.github.io/topnewsfeed/topnewsfeed.min.js';document.body.appendChild(s);})()
The source code is available on GitHub.

how could I post feed like tetris battle or glassdoor using facebook api?

what I mean is...
in facebook timeline mode,
tetris battle and glassdoor, those 2 fb apps post feed on the right hand side as picture below
http://imgur.com/RinJh
is it an original feed post?
how could I use api to post feed like this?
I'm not really sure if this is the right answer
but maybe it's a "meta tags" game, I mean facebook has multiple meta tags that you could add to your website and facebook uses to classify pages when it scrapes the web, check out step 2 in this page http://developers.facebook.com/docs/reference/plugins/like/
there's for example a tag that specifies the type of the page
and song is one of the allowed values (that maybe SoundCloud is using for it's pages)
is it an original feed post?
No, these are most likely Aggregations of Open Graph actions.
https://developers.facebook.com/docs/concepts/opengraph/aggregations/

How can I get all the URLs (outside of Facebook) a Facebook user liked via a Like button embedded in an external site?

I tried several options:
https://graph.facebook.com/me/likes ,
https://graph.facebook.com/me/links
and a couple of FQL queries - but none returned Likes a user makes via Like buttons on external sites.
Any ideas?
You just take the Extended Permission of user_likes, you will get what you are looking for....
I think that user_likes only give you the permission to see all real objects that the user likes:
a movie,a musician...
if a page is tagged as article for example:
it won't be shown in the likes request
https://graph.facebook.com/me/likes
cause there is no object in the social graph for it:
"Note that the Open Graph protocol is currently designed to support real-life objects. If your URL is a piece of content — such as a news article, photo, video, or similar — you should set og:type to article (see below). Pages of type article do not have publishing rights, and will not show up on user's profiles because they are not real world objects."
(http://developers.facebook.com/docs/opengraph/)
I am also looking for the same api request, I'll let you know if I'll find it...
Editing:
Ok I asked this question on Facebook:
http://forum.developers.facebook.net/viewtopic.php?id=94745
and there is no way of doing that.