How to update facebook profile info from code? - facebook

Does someone know the API for updating user profile information on facebook?
I want for instance to change my location from my client application. Is that possible?
I am using Facebook C# SDK, but an example in any other language would be great.

I do not believe they support updating a user's profile information from the exposed Facebook API. The Graph API documentation currently states that only the following elements are editable (editable as in, you can create them):
Wall Posts (feed)
Object Comments
Likes
Notes
links
events
event status
albums
album photos
checkins
As you can see, the User object is not one of objects Facebook exposes for edit purposes. It does support the ability to publish location checkins, however. While this does not meet your goal of modifying the location attribute of a user's profile, it does provide some basic abilities.
POST https://graph.facebook.com/<profile_id>/checkins?
access_token=<access_token>
&coordinates={...}
&message=my+message
&place=<page_id>
&tags=<tag1>,<tag2>,...
See the checkin documentation for an example using curl. This example should be executable by any platform specific Facebook API (Java, C#, etc..).

You can't update informations from the API. All you can do is reading / searching / posting / deleting / analysing data.
You can find everything there.
Cheers

Related

Which Instagram API should I use to collect public data?

Does either the Instagram Basic Display API or the Instagram Graph API allow me to simply get any public user's posts/media programatically? Everywhere in the documentation it says "User data" but it feels like I can only get data of the user that got authenticated using the API. I've set up a Facebook dev account and currently spending 4th hour on calling both APIs without success. Can anyone who has used them help me clear this up?
Most likely, Instagram API Date 365, a tool I currently work for, may help you as an alternative to using Instagram Basic Display API or the Instagram Graph API because this API is created especially for scraping bulk data about posts and users.
You can get such post data as post content (text, language, list of hashtags, list of tagged users), owner ID, location ID,
engagement info, etc. Also, it is possible to download comments (selected or on a specific post) and replies to them.
You can view this for more info.

Using C# to extract Facebook data

I have just started to develop an application for Facebook. I searched a lot in the internet but I could not find any comprehensive answer to my questions. I really hope that someone can help me. I have below questions:
Background:
I am developing a web application and I have registered my web application in Facebook and I have got my AppID and Secret. My requirement is to
Extract friend's list of users registered to my web application (When user logs in, he/she should be able to see all his/her friends in my application as well
When user clicks on his/her Facebook friend from my application, I want to be able to extract friend's information as well (like movies, interests, likes and groups)
In nutshell, 1) Extract one's friends list 2) Extract friend's information.
My second question is that, How to initilize FacebookWebApplication object? In a post in StackOverflow, I saw an answer to use "DefaultFacebookWebApplication" but this class is not available in my dll.
To your first question:
You'll want to get familiar with the Graph API http://developers.facebook.com/docs/reference/api.
You will be making web requests to the Graph API and parsing a response composed of JSON. There are several open source SDKs available to help you out. I would reccomend this one:
http://msdn.microsoft.com/en-us/windows/ee388574.
Hope that helps!
I would look at the newer Facebook C# SDK on CodePlex, it is actively supported & available as NuGet modules : http://facebooksdk.codeplex.com/ - or just search for "Facebook" in NuGet. Here is simple example using the SDK: http://facebooksdk.codeplex.com/wikipage?title=Getting%20Started%20with%20an%20ASP.NET%20MVC%203%20Website

Get Facebook wall data to web portal

I have web portal. I need to somehow get all Facebook wall posts from just one specific user or group( that represents my web portal). I need to have wall posts available on my web portal for further processing.
I will be also needing an option for posting messages from web portal to FB user/group wall.
I haven`t worked with FB API until now, so any materials, tutorials that can lead me in right direction would be of great help.
Can this be done without creating Facebook application?
Thank you
No,
Facebook just like that does not share its user information.
you will have to create an app on facebook to authorize urself,and on your web portal you will have to sek users permission before getting any user info.
craete facebook app here https://developers.facebook.com/apps
You can choose between javascript sdk and graph api on how you want to get user data.
You can use publish_stream permisiion to get the post on user wall.
Can this be done without creating Facebook application?
NO
Tutorials and materials:
Graph API
Samples & How-Tos
Google, but I would be careful here. Try to search for updated tutorials (written or updated on 2011)
I used this http://neosmart.de/social-media/facebook-wall its fb.wall plugin into jQuery .js library. It easy and can be edited symply via CSS

Programmatically posting Facebook comments

My application has obtained publish_stream permissions for a Facebook user.
I'd like to allow the user to post comments for a target URL directly from my mobile application, rather than opening up an embedded browser that then shows the Comment Box plugin. That is, the user doesn't necessarily want to post the link to their feed -- rather they want to participate in any Facebook comment discussion that surrounds that URL.
Naturally, I can read the comments for any URL via the Graph API (eg: a techcrunch article) but I do not know how, or if I can add comments to an arbitrary URL programmatically.
Would love to hear any other suggestions or workarounds as well. My hope is to piggy back on Facebook comments to allow my users to have a conversation surrounding URLs of interest to them. If at all possible, I'd also prefer to use Facebook, though I can see using Disqus or similar services would be another possibility.
Use graph api, demo comments here
make POST to
http://graph.facebook.com/comments/?ids=http://techcrunch.com/2011/07/22/big-surprise-the-ipad-trumps-android-tablets-at-the-office/
with field message and value "yourmessage"
I genuine Facebook API bug.
Cannot comment via Graph API on Comments Plugin (Probably try Legacy API)
Graph API

Streaming Facebook Pages Wall (not just the pages posts)

I have looked on 100 forums looking for a simple answer for how to stream every post on a Facebook page's wall (not using the like box for just the pages posts, but everyone's posts). I am the admin of the page and I am already using the like box for my posts so I understand that, however the developer pages of Facebook are too confusing for such a simple task. I will be inserting the stream into an HTML page which will be hosted on www.1and1.com so it can handle most, if not all code.
I know it is a lot to ask but is there evem someplace online that will offer plain step-by-step instructions for my specific needs?
If the social plugins they make available aren't sufficient, you could just pull in the feed with the Facebook graph api using the javascript sdk (easiest) or there is probably an SDK for whatever programming language you know. For example, you can see a list of posts on the coca cola page using the Facebook graph explorer:
https://developers.facebook.com/tools/explorer/?method=GET&path=cocacola%2Ffeed
The /page/feed method needs an access token, but you can use the graph explorer to get an offline_access token that you can use to pull the data in. This may eliminate javascript sdk usage though unless you want to first prompt users to authenticate your application. But otherwise you would just parse the json feed that is returned in the url indicated in the graph explorer (and add your access_token to the end of the url).
Here is a good PHP tutorial on how to display a groups feed on a web page. It would be just as easy to display the posts from a page (since you are the admin)
Just replace the group ID with the page ID. Here is a link to the feed for the Facebook Platform feed graph api results. More info on FB Pages here.