Read Facebook Post - facebook

I am writing a web application using c#.net 4.0 to read post in a specific Facebook page.
E.g. http://www.facebook.com/pages/Public-Service-Association/164106710269112
I used Facebook C# SDK from http://github.com/facebook/csharp-sdk/
Please help me to read the posts using above SDK?
Thanks.

After you follow the tutorial, after you declare a JSON for your results, simple get their Profile Feed:
Facebook.FacebookAPI api = new Facebook.FacebookAPI(token); //place your access token
JSONObject result = api.Get(#"/nzpsa/feed");

Related

FaceBook FQL Query Not Working

We have used the v2.0 graph API & FQL(FaceBook Query Language) for getting the FaceBook details in our project. But recently the result is empty.
I have checked the developer.facebook.com and i found one solution that is Login Review process. We need to get the FB details means we need to get the pre approval from FB.(user_photos, user_videos) It'll work perfectly or not ?
https://developers.facebook.com/blog/post/2015/04/28/april-30-migration/
Sample Code :
args = "SELECT uid,name FROM user WHERE uid = me()"
file = urllib2.urlopen("https://api.facebook.com/method/fql.query?" + urllib.urlencode(args), timeout=3)
Please give some suggestion to fix this problem.
https://developers.facebook.com/docs/apps/api-v1-deprecation
Advance Thanks :)
Have a look at
https://developers.facebook.com/docs/apps/changelog#v2_1_deprecations
The FQL and REST APIs are no longer available in v2.1: Previously announced with v2.0, apps must migrate to versioned Graph API calls starting with v2.1.
You're querying the REST API which is deprecated, as cited. Use https://graph.facebook.com/fql instead.

AS3: Post to Facebook Wall - Error #2032

I am currently developing an app with which visitors of an event can take pictures using a webcam and upload them to Facebook using an AS3-application. I know I can connect to Facebook, because I can log the user out using the API and I can get all the information. The problem is that I can't post to their wall for some reason. I keep getting the following error:
error #2032: stream error. url: https://graph.facebook.com/********/feed
I use the following code to post to Facebook:
private function postFB(e:Event=null):void {
var _params:Object = new Object();
_params.uid = Facebook.getAuthResponse().uid;
_params.access_token = Facebook.getAuthResponse().accessToken;
_params.message = "I was at the Thanksgiving Day Event.";
//_params.picture = _bitmap;
Facebook.api("/me/feed", postComplete, _params, "POST");
}
As I've said before, I know I am connected to facebook because if I change "POST" to "GET" in my api-call, I get all the information of my account. I have the correct permissions as far as I know (read_stream, publish_stream, user_photos). I use GraphAPI_Web_1_8_1.swc as an api.
The documentation on the entire api is very poor, so I am trying to figure out the problem. It's been a few years since I've tried any of this, so my code has probably aged too far by now. So, any ideas what I'm doing wrong?
publish_stream is deprecated (since years?), you need to use publish_actions.
If that does not work, make sure the Access Token includes all the permissions, you can test this in the Debugger: https://developers.facebook.com/tools/debug/
Side note: AS3 is not getting used very often anymore, the last version of the the AS3 SDK is from 2011. It may be a good idea to switch to the JavaScript SDK.

how to post a picture to user group using facebook4j api using facebook groupid

How to post a picture to user group using facebook4j api using facebook groupid.
PostUpdate post = new PostUpdate(new URL("projectUrl")).picture(new URL("projectUrl/waz24.jpg")).name("Facebook4J - A Java library for the Facebook Graph API");
facebook.postGroupFeed(getId, post);
above code not showing image it shows some symbol.
Use this for sharing photo with link and description.
PrivacyParameter privacy = new PrivacyBuilder().setValue(PrivacyType.ALL_FRIENDS).build();
PostUpdate postUpdate = new PostUpdate(new URL("http://facebook4j.org"))
.picture(new URL("http://facebook4j.org/images/hero.png"))
.name("Facebook4J - A Java library for the Facebook Graph API")
.caption("facebook4j.org")
.description("Facebook4J is a Java library for the Facebook Graph API. This library provides the ease of use like Twitter4J. Facebook4J is an unofficial library.")
.privacy(privacy);
String postId = facebook.postFeed(postUpdate);
Thanks..

feed_PublishTemplatizedAction() returns true, but not posted on my FansPage

I need to publish a feed entry to my FansPage. For that I have used the codes as follows,
userClient = new FacebookXmlRestClient(api_key, secret);
if(userClient.users_hasAppPermission(Permission.OFFLINE_ACCESS, longFacebookUserID)){
TemplatizedAction action = new TemplatizedAction("{actor} recommends {book}");
action.setPageActorId(ctProfileId);//fansPageId
action.addTitleParam("book", "<a href='http://www.amazon.com/Hamlet/dp/0140714545/'>Hamlet</a>");
action.setBodyTemplate("{actor} is using BooksApp!");
action.setBodyGeneral("100 other people recommend this book!");
action.addPicture("http://code.google.com/hosting/images/code_sm.png", "http://www.google.com");
userClient.feed_PublishTemplatizedAction(action);}
When Im executing this code, feed_PublishTemplatizedAction() returns true but not posted on my FansPage.
Can anybody give me the Guidelines.
Thanks,
jerry.
Feed templates have been deprecated and no longer work. You should read up on Feeds / Stream publishing. In addition, you should mode away from the REST API and use the Graph API instead. You app and code appear massively out of date.
You can use the '/me/feed' API call to publish to the users wall.

Titanium.Facebook getting graph api access token

I'm developing an iPhone app with Appcelerator Titanium SDK 1.6.2
I am upload an photo to a users facebook album with the Titanium Facebook module, graph api.
The upload goes just fine and returns the items unique ID.
When I try to parse the JSON from the unique id I'm told i need to pass an access token, which makes sense.
How do I get the access token to be passed to the graph request url?
When I do a XHR GET request while passing Ti.Facebook.accessToken I get the following error
URL: https://graph.facebook.com/10150527948301195?access_token=t4CqzHallahfy4d7RnERrJb4ffOkQfJvrYrGEBoZ4so.epdiI6IjJGR2ZFY1ZTMHh6RlR6ZmNIcVctMHcifQ.NBRMth0vb7pXKcd8lHNz9aremoyNpvrbhz2P3zkgWJU4eHdfewOp1WruBNZS_lSDy0XM0Xu0ACry8aEmSckGJVQJxEioykrNZhT7S9mJG2OKWqMdk6ucg5IMhXMfndF9sdKwWrWb7uPKI57LzIOf5lvA
{
error = {
message = "Unsupported post request.";
type = GraphMethodException;
};
}
And if I don't pass Ti.Facebook.accessToken I'm asked for it.
I'm bound to be missing something, any help would be greatly appreciated.
see this link http://developer.appcelerator.com/blog/2011/02/facebook-module-changes-in-titanium-mobile-1-6-0.html
I think you should be using Titanium.Facebook.requestWithGraphPath(...)