I know that on a Facebook fan page, if you want to make a post visible to only a specific set of people based on their facebook language we can do that. For Eg. If I want to post a post that is visible to only people who have set Facebook language to French, then I can set the "Make visible: language -> French" when I post it.
Now, I want to do this programmatically. I have 2 sets of text. I want to post one of them to a certain set of languages and other for just french. Say, first set for "English, Spanish, Polish" while the second set for just "French". How can I do this programmatically? Does facebook API allows us to do that?
Thanks.
I've not tried this but the documentation here https://developers.facebook.com/docs/reference/api/page/#posts seems to imply you can include a "targeting" property. Try playing around with that in the graph api explorer to see if it achieves what you are after. I'm assuming you know how to use the api as you merely mentioned the language side of it. If you don't know what you can do with the api then I suggest you check out the docs as mentioned by Matt in the comments
Related
Since a while its possible to post on Facebook multilingual:
https://code.facebook.com/posts/597373993776783/building-a-better-way-to-write-posts-in-multiple-languages/
I'm posting on my page in German and English and I wanna integrate my Facebook posts on a website. If you use the website English, I wanna present them the English versions of my posts.
So, I try to get the posts multilinugal, but I couldn't find any option in the Graph API Explorer. The posts always show up in the default language.
https://developers.facebook.com/tools/explorer/
Is it possible to get (feed) Facebook posts multilingual?
You can use the locale parameter for that,
https://developers.facebook.com/docs/graph-api/using-graph-api/#readmodifiers:
locale
Used if your app needs the ability to retrieve localized content in the language of a particular locale (when available).
If the post is available in the requested locale, you will get that one returned - otherwise, the “default” language version of the post.
I just started using the eBay API, but couldn't find a way to accomplish my needs. Also this should be really simple normally.
I want to know if it is possible to pass just any eBay URL to the API (PHP) and get a new link with my affiliate-parameters added.
It should just work the same way like the Link Generator in the Partner-Network-Section on eBay.
For example:
www.ebay.de/some-ebay-url/
Should be turned into something like:
http://rover.ebay.com/rover/x/xxx-xxxxx-xxxxx-x/x?xxx=4&pub=[my_publisher_id]&toolid=10001&campid=[my_campaign_id]&customid=&mpre=http%3A%2F%2Fwww.ebay.de%2Fsome-ebay-url
Or is there a easy way to just add my Affiliate id to an ordinary link?
Thanks
There isn't an API call at eBay to do what you want, in part because you can do it yourself pretty easily. You kinda already did it yourself with your example - yes, it's that easy.
You basically use the Link Generator just once (or a few times, to get acquainted with things) to obtain the template of a rover link and select the Custom URL option, then you use that format with any eBay URL you like, making any required tweaks. Take the eBay URL you want, URL encode it, then insert it as the &mpre= parameter at the end of the affiliate/rover link. That's the gist of it.
Know that &pub= is optional and doesn't affect the tracking of your link. &campid= is the necessary tracking parameter.
The long numerals in the front of the rover link (Rotation/Placement ID) define what ePN program to attribute tracking to. You might need to parse your input URL to determine the eBay domain (eBay.com? eBay.de?) to decide which Rotation/Placement ID to use, although they may/should work for cross-site tracking if you desire.
I've documented all the Rotation IDs here on my site. Click the page title up top for the main site with more eBay technical info I've discovered over the years.
I have a multi-languages website (en_US + fr_FR), I made it using CakePHP.
The first time a user comes to my website, the language will be define using the $_SERVER['HTTP_ACCEPT_LANGUAGE'], or the default language (en_US) if $_SERVER['HTTP_ACCEPT_LANGUAGE'] is not set.
So the problem is that my OpenGraph tags are differents depending on the language, but the Facebook scraper doesn't have any $_SERVER['HTTP_ACCEPT_LANGUAGE'] var... so he'll always choose the default language (en_US), even if the user that clicked on the Share Link was French.
So my question is :
How can I force Facebook to choose a different language when scraping my webpage.
I already took a look at this url : https://developers.facebook.com/docs/opengraph/guides/internationalization/ but I didn't understand anything...
Please, help !
(actually I'll have to do the same thing with Google+ share link too... but Facebook is more important right now)
EDIT :
My webpage URL doesn't change when the language changes. It's always http://my-website.com/
EDIT 2 :
I think I managed to make it works.
The answer was really in the doc : https://developers.facebook.com/docs/opengraph/guides/internationalization/ but it was really hard to understand.
But now how can I change my language in Facebook to check that it really works (because now, it always gives me the French translation instead of the default language) ?
Actually, I had to add a way to set the website language using the URL :
http://my-website.com/en/ or http://my-website.com/?lang=en
It is much more easier this way to share my website in different languages AND this is a recommandation from Google
I tried with graph api asked many things to there but none of them are returns comments.
I want to get all comments, and put in a separate page for search engines to scan and index.
comments are very rich full and I want them
You can retreive comments (actually posts and their comments) from the Comments plugin from this api url:
https://graph.facebook.com/comments/?ids={$url_of_your_page}
please see the documentation here: http://developers.facebook.com/docs/reference/fql/
the table you need to query is this here:
http://developers.facebook.com/docs/reference/fql/comment/
(it is also one of the first examples)
the key is that you can specify an identifier for every comment plugin that you embed. using this identifier you can then select comments using the graph api.
regarding search engines you should not make the impression that you are serving different content to the spiders than to the users so it would probably be a good idea to load the comments over the api by default (please cache them) and then replace it by the javascript box if javascript is available, so the users can write new comments.
even better (in my opinion) would be always to display the comments in html in your website and only load the facebook comments plugin if the user wants to make a new comment. but that probably requires one additional step for the user.
you can also read about the ajax chrawling scheme
If you want to use the graph API what you do is grab the comment ID in the json (the very first number you see and it appears as {user_id}_{status_message_ID} example: 1234_5678910) and then have https://graph.facebook.com/{the number you got}?access_token={access token}
Do reduce strain what you could do is run the system that you do to put all the status messages and comments onto your website (for instance a 'for each' or 'while' statements etc) then add an 'if' statement that says if count (under comments on the json) is more than 3 it'll retrieve the json for that post using the id and spit out your data.
I hope this was of some help. Please say if you want anything explained further.
Regards,
Jon
You can use this url to get comments of an url and paginate them:
?fields=og_object{comments.order(reverse_chronological).limit(10).after(NgZDZD)}&id={YOUR_URL}
Even It works with latest(v2.10) graph version.
I'm trying to make a Facebook application that utilises the multi-friend-selector to let someone answer a question. (eg: why do you think is the most awesome? you get multi friend selector below, choose someone and click post to his wall).
I've the post to wall part working fine using PHP. Right now though the friend to be asked a question is picked randomly.
Now the question. Is there a way to use PHP to render a multi-friend-selector or do i HAVE to go back and do this whole thing using Javascript?
The multi-friend-selector is under Facebook's control and you cannot use for anything other than sending invitations. So unfortunately you'd have to use your own. Fortunately though, someone else already had this problem and wrote one for you: Facebook – Friends selection custom component. Note that it does use some JavaScript.