It sure is a pain to prune a Facebook profile. Is there any way using the Facebook API (or some other mechanism) to authenticate as a particular user and remove friends from the user's list? I have looked through the API documentation, but I'm not familiar with the ins and outs of the platform.
I have been through the complete facebook graph api documentation on facebook while i was writing my open source .net sdk for facebook. From all that i understand, i am 99.9 % sure that this cannot be done using their api. You can create status messages, links, photos, albums, events, pages, notes etc using their api ( you need to perform simple post operations for all this ), but i have read no where that a friend can be removed using facebook api !
No API but you can program your browser or mimick a browser. Think of QtWebKit. I doubt if you need to add so many friends and just to remove them using machine.
Related
I am trying to post a single tweet in my Windows phone application to any twitter account. I don't want to complicate my code using external libs or APIs. If they are unavoidable, I will include. I don't need to read any tweets or need to persist my connection. Its simple, The user supplies a username, password and a tweet message and hits tweet.
The famous temple run in iPhone has exactly what I need (screenshot below).
Please guide me in C#
This is possible via XAuth. The technique is not straight forward though, your request will have to go through the Twitter API team and once they approve they will give the xAuth Access. See this other SOF answer for more details.
If you want to integrate it like in you screenshot I think you need to communicate with the API yourself.
But there is the ShareStatusTask in the Microsoft.Phone.Tasks namespace.
With that users can share your status to the social media they configured.
Also check: http://msdn.microsoft.com/en-us/library/hh394027(v=vs.92).aspx
You have two choices:
use the built-in ShareStatusTask
roll your own system.
The advantage of ShareStatusTask is that it is simple to implement and maintain.
For the user it is also a good solution as it will allow him to post the status on the social network of its choice and it avoids forcing him to authenticate again.
If you want to roll your own system, you'll have to deal with different problems:
user authentication (OAuth)
maintenance (sometimes Twitter like to change the way 3rd party apps
interact with them...)
Here is a tutorial that explains how to implement Twitter in a Windows Phone app.
Also Tweetsharp is a nice Twitter lib you can use
I have found many examples of getting data from facebook manually.
Is there a way to grab the data using an application (not a web app)?
What we are doing is creating a data repository for our customers so they can look at their data from FB, GA, twitter ect all in one place.
Facebook has me stuck as I can get an authentication code, but none of the URLs such as https://graph.facebook.com/me/friends?access_token=... will work. Guessing because "me" means I need to be logged into my site for it to work.
Any help/examples would be great.
Thank You
I am developing a Facebook application, where my application will aggregate all the photos of my friends in their albums. How will i achieve using graph api and C#?
First, look at this answer: Can I use the Facebook graph api to get user's friends profiles pictures ?
This will let you know how to generally use the graph api to get the to the friends. If you use albums instead of photo, you should get all the albums of a friend.
To get there, you will also need the friends_photos permission. I don't know if it is still up to date, but maybe you will need some more permissions.
I'm no C# developer, but these links will help you:
C# Facebook Graph API Library
Facebook C# SDK
Facebook API from C# – Getting the list of friends
Facebook recently made a nice tool you can use to explore how to get the details you need. It's called the Graph API Explorer and can be found here: https://developers.facebook.com/tools/explorer
But what is said in the other answer is correct. First you get the list of friends. Then their albums, and then the photos in the albums. Once you get the hang of the Graph API it's quite easy, but it requires a bit of tinkering to figure out at first.
If you are using C# you can use a WebRequest to get the data. Whenever you access http://graph.facebook.com/whateveryouwant it will return a string of JSON-data. This you can parse using a JSON-librabry like litJSON.
I have made an application that gets the profile photos, and it is not that hard. Just remember to get the right permissions.
The easiest way to do this is to use the Javascript API to get the loginstatus and then get some permissions. If you set cookies: true when you init the Facebook API you can get the accesss_token from the cookie. The cookie is named "fbs_YOURAPPID".
Also you need to make a developer app to get an access_token.
I was wondering, is there a way I can create an application which for example updates both my facebook and my twitter at the same time?
So for example I have a GUI which has a similar interface as my facebook profile (or whatever), and I want to post a comment on my profile through my GUI, so I write a line in a GUI textbox, press apply and it adds the post to my facebook profile and at the same time to my twitter for example.
I know this sounds silly since u can media link both pages, but that's not my true goal, I'm just wondering if this is possible so I can extend it to other facebook services.
See
facebook API
twitter API
And (.NET related) :
C# Facebook API
C# Twitter API(unofficial)
Yes, it is definitely possible. You would have to use the APIs exposed by Facebook and Twitter. You can then post let's say status on both twitter and facebook by calling update status related APIs of both Twitter and Facebook on the apply button click event.
You can use this for Twitter and this for Facebook both are C# clients for Twitter and Facebook respectively.
Yes it is. I don't see how this wouldn't be.
Also, I suggest you have a look at Seesmic Desktop for an application that does that which use Silverlight.
I'm using the Facebook API Graph (C# & ASP.NET) to try to dynamically post to a Facebook page I created.
Looking at the code samples floating around.. they suggest creating a Facebook App first (which I have done)..
However..
I have 3 different pages I want to post to.. Do I need to create an app for each? (I want to post different things to the 3 pages, not the same posts to each)
I just want messages & links to appear as Wall posts. I'm not bothered about having an 'app' that has 'canvas' that is placed in an IFrame.
Question : So do I still need to write one or more Facebook Apps to post to my 3 different Facebook pages??
Where I am so far.. I can pass in my apps credentials and get back the access_token. But my posts don't appear to be going anywhere.
I'd rather drop the 'facebook application /canvas' approach if possible If I can post directly to a wall (For the above reasons).
Oh, and before you ask. I don't want to post to my Apps Wall page, I want to post to my other pages (Unless I have to post to my Apps Wall page first?).
I'm sure loads of people have the same questions..
Thanks in advance.
-- Lee
You can do this with only one app
You'll need these permissions offline_access, publish_stream,
manage_page
After "me" request in response you should parse active_tokens of pages
you administer
Before you make publish request make sure you set
"_facebook.active_token" to
active_token of page where you want
to publish
I think you need to create the Facebook App, because that's the only way you'll get the set of API keys you need for using the API. I think that's the only reason. It's the same when you're using Facebook only for authentication.
1 - I have 3 different pages I want to post to.. Do I need to create an app for each?
No because there is an option to allow an single app to handle multiple pages.
2 - I just want messages & links to appear as Wall posts. I'm not bothered about having an 'app' that has 'canvas' that is placed in an IFrame.
You can do that surely with the help of their Graph API.
You don't necessarily need a canvas, though keep in mind that's where users will go when they click on the name of your app.
Take a look at the Graph API: http://developers.facebook.com/docs/api, particularly the Publishing section. You want to use /PROFILE_ID/feed, where PROFILE_ID is the id of the page you want to post to.