i want to fetch facebook wall messages through c# - c#

I’m able to post on wall, but I need to fetch Facebook wall messages through C#
==Update==
Now I’m getting wall messages, but now I want the messages with date.

You need the Graph API.
And to make a request to get the wall posts you need a extended permission on the authentication.

Facebook developer kit is your way to go...

Have you studied the FB API already or are you starting from scratch?
You can use Stream.Get to access wall posts, try reading the wiki:
http://wiki.developers.facebook.com/index.php/Stream.get
(You must have permission to access the users page of course)

I think there are many ways to do this, here is one example:
Make sure you have the permission "read_stream".
Then read all streams to get the messages on the wall;
var streams = API.Stream.Get(new List<long> { }, null, null, null);
streams.posts.stream_post.ForEach(post => Console.WriteLine(post.message));
'API' comes from your masterpage that has been inherited by Facebook.Web.CanvasIFrameMasterPage.

Responding to an old question, but i recently wrote a blog post on the same, i think it might help others who land to this question while Google search, read the post here (its using a custom built Facebook Connector)
click here to read

I want to do the same. Facebook API is changing and now it only returns few of the post even if you put LIMIT and UNTIL/SINCE parameters, so you have to change to FQL.
With FQL you can read stream table and get the posts made by the user and the post made by others in the walls's user.

Related

What are the ways to post a tweet to twitter with asp.net c#? [duplicate]

With Twitter's new OAuth interface, their API is now many times more complex than what it was. And I haven't even looked at Facebook's API yet.
What I'm wondering if there is a method that employs some higher-level, existing code or interfaces to make this a simpler task.
All I want to be able to do is initiate a Twitter tweet or Facebook share on the user's behalf and be able to control the initial text of those messages, from an ASP.NET application.
I found some similar questions on SO, but they had no answers.
EDIT: I know there are things like AddThis and ShareThis, but I need something that will give me control over the default message. It must contain a link with a code that is specific to the current user.
Twitter Integration...
For making Tweets from an ASP.NET application on users' behalf, check out Twitterizer. It's a free, open-source project for integrating with Twitter from .NET applications.
I agree that using OAuth can be a bit daunting, but the Twitterizer API wraps up most of the complexity. I've written an article on using Twitterizer in an ASP.NET application that you may be interested in: Integrating Twitter Into An ASP.NET Website Using OAuth. After reading the article, download the code sample at the end, which is a working demo showing how to use Twitterizer to post a tweet from an ASP.NET website.
Facebook Integration...
For integrating with Facebook, chcek out the Facebook Developer Toolkit. Like Twitterizer, it's an open-source, free API and should get you going in the right direction.
Happy Programming!
After looking around for a while, I found sharethis.com. They have various share buttons you can add to your site that send Twitter tweets, Facebook shares, etc.
It looks like it also supports options to control the URL, so I could modify this to include whatever URL I need.
I haven't yet figured out if I can control the default message text. I'm looking into that.
But it seems like this is probably the simplest way to accomplish what I want.
This is probably what you're after for twitter: https://twitter.com/about/resources/buttons#tweet
Let's you configure a button (or URL to redirect to) that starts the user off with some default text. The user can change the text before they post.
Don't know about facebook.
Twitter Integration:
Check this code and link/article simple and easy :
protected void btnTweet_Click(object sender, EventArgs e)
{
string oauthAccessToken = Session["twtoken"].ToString();
string oauthAccessTokenSecret = Session["twsecret"].ToString();
OAuthHelper oauthhelper = new OAuthHelper();
oauthhelper.TweetOnBehalfOf(oauthAccessToken, oauthAccessTokenSecret, txtTweet.Text);
if (string.IsNullOrEmpty(oauthhelper.oauth_error))
Response.Write("Twit Posted Successfully");
else
Response.Write(oauthhelper.oauth_error);
}
Read more how to get access token and secret key and download OAuthHelper and OAuthUtility Class below is the link -
How to post tweet on behalf of an user from asp.net using oauth authentication
Login with twitter using oauth authentication in asp.net and get access token, screen name and userid

Tumblr oAuth in .NET or C# get Blog posts

I'm trying simply to list a secured blog post from tumblr via .NET or C# there is a few non resolved posts and some examples how to post but not get.
Did anyone has some working code for it?
I've tried this:
http://www.codeproject.com/Tips/578418/Integrate-Tumblr-into-Csharp-NET-Website
http://dotnetopenauth.net/
Thanks
Why are you trying to get a secured blog post?
The documentation here is quite straightforward for getting a list of blogs for a certain user and all you need is the ApiKey so you don't need to OAuth at all. It is a GET request like so:
api.tumblr.com/v2/blog/{base-hostname}/posts[/type]?api_key={key}&[optional-params=]
You'll need to try this to see if your secured post comes back.

Share with Facebook in MVC 3

I'm developing an application online in MVC 3 who consists to manage a tennis club...
When a tennis player make a reservation for a tennis game, I would like to allow this tennis player to share his game with Facebook...
Is it possible ?
I have found that but no more...
Have you an idea or some tutorials ?
Thanks in advance
You could use the C# Facebook SDK. For example to post to the wall as shown in the documentation:
var fb = new FacebookClient("access_token");
dynamic result = fb.Post("me/feed", new { message = "My first wall post using Facebook C# SDK" });
var newPostId = result.id;
It can be done in many ways
You can use the graph api. (but i would recommend it for more complex interaction)
But the most simple one is to start sharing using the following url.
https://www.facebook.com/sharer.php?u=&t=
For details you can refer to Facebook documentations
There are 2 key ways in which you could achieve this:
Option 1 - Server-Side (Facebook for Websites)
Upon creation, your server could post to the users wall, if the user desires. This would be slightly more complicated to set-up, but would be more automated. You would need to set-up an app-id and ask the user to authenticate their facebook details.
Option 2 - Client-side (Facebook Share)
After creation, the user could be prompted with a Share or Like button, that would in turn post it to his or her wall. This would require the user an extra click, but would be more straight forward to set-up.
A Step by step tutorial is available here to integrate social plugin into mvc

.Need to check whether the facebook user is atleast 3 months on facebook

I just want to check whether the facebook user is atleast on facebook for more than 3 months. This is being used by an Facebook Application.
I have all permissions with me.
I am using Facebook C# SDK and using facebook graph API.
Doesnt matter if it is even 60% accurate
I googled it for too long but doesnt find anything
Any help is appreciated
well, using this query it's not totally what you are looking for but:
fql?q=SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id = me() AND created_time < 1327677300 LIMIT 1
If this query returns something then you are sure the user is on facebook from more than 3 months. Otherwise if the query returns an empty array probably the user is not at least 3 months on facebook, but you cannot be totally sure of it.
It is always hard to answer this with certainity but there is no information on how to retrieve this field in any permission or data received from Facebook. I have never come across it.
From this lack of information I would say it is not possible.
A possible solution, would be to get access to the user post's and get the date of the earliest one.

How to get twitter user timeline in C# using Twitterizer

i have the following code.
Twitter t1 = new Twitter("twitteruser","password");
TwitterUser user = t1.User.Show("username");
if (user != null)
{
TwitterParameters param = new TwitterParameters();
param.Add(TwitterParameterNames.UserID, user.ID);
TwitterStatusCollection t =t1.Status.UserTimeline(param);
}
In the above code, I want to get user timeline. I am using Twitterizer API. The twitter documentation for getting timeline of user is Here
I have checked the fiddler whats going on. In fiddler the request is :
http://api.twitter.com/1/direct_messages.xml?user_id=xxxxx
while i am expecting
http://twitter.com/statuses/user_timeline.format
Is anything left which i miss.
This is a bug in the latest version of the Twitterizer Library.
I will try to get this corrected and post an update today.
If you run into any other issues, please contact the Twitterizer group directly, on our site (http://www.twitterizer.net/) you'll find links to our mailing list, twitter account, and you can submit but reports directly to our team.
Ricky (Twitterizer founder)
Here's how to get a user's timeline without using oAuth or any authentication, for that matter:
UserTimelineOptions options = new UserTimelineOptions();
options.ScreenName = "SCREENNAME OF TWITTER USER";
TwitterStatusCollection tweets = TwitterTimeline.UserTimeline(options).ResponseObject;
I have to agree with Eric. I only looked at Twitterizer for a few hours, and I have not found one example that shows how to load a user's timeline without authorization.
Will I figure it out eventually? Yeah, I'll have to and I will; but it will take me forever.
The link that Ricky Smith gave (twitterizer.net) doesn't have this kind of simple example. The tutorials available on the internet that I found for twitterizer2, even those are not up-to-date and don't quite work or are missing information.
Ricky, how about being a lifesaver to me and others and showing us how to simply look at a user's public timeline, so there's no need for authorization? Whaddya'say?

Categories

Resources