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?
Related
Long shot, but I'd like to fiddle with ViaGogo API (C# library more precisely). ViaGogo has a well documented public API, documentation is avaliable here.
Problem is, you need to authenticated as it usually happens with this kind of APIs: usually, you find a section of the website, maybe in your profile section, where you can obtain keys, secrets and so on (this happens for example on Facebook or Amazon).
As for ViaGogo, I only found a link that points to a Google Form: this form asks for info about advertising and affiliation on a complete different level of what I need, I won't publish anything read via API. Furthermore, there's no field to leave an e-mail address.
Their C# library seems pretty popular as far as I can tell from downloads from NuGet; I wonder how all these thousands of devs succesfully called that API.
Has anyone succesfully obtained authentication info from ViaGogo?
According to note in registration form, you have to wait for 30 days for their reply.
For more help you can contact them on following contacts:
E-mail: affiliate#viagogo.com
Telephone: +442075532777
Or
http://www.viagogo.com/in/help
There doesn't seem to be any way around this registration according to their website and the api itself -- an appID and password is required. You may try your luck emailing them at Affiliate.Team#viagogo.com -- see this issue on github where the possibility of getting an account via email is discussed: https://github.com/viagogo/developer.viagogo.net/issues/24
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
Using Facebook Graph API, I am trying to get ALL of the photos from a given album ID. I tried finding it on Facebook Graph Reference site, but couldn't find any help. So here it is what I am doing.
I have a valid access token with permission of user_photos and friend_photos. I already verified that facebook debugger site. I already have the album id. And following is my URL that I am passing:
https://graph.facebook.com/<albumId>/photos?access_token=<my-valid-access-token>
I do get 4 photos, but I have 29 photos in total. Also, I don't see any cursor for "prev" or "next". So, now, I am lost. Don't know what I am missing here. Any help is appreciated. I am using Facebook SDK for .NET.
So, here is the solution that worked for me:
For facebook options, I already had "user_photos" and "friend_photos" as part of the scope. "friend_photos" is not really relevant here. I had to ADD "user_checkins" to the scope collection to get all of the photos that I had in my given album. So here it is that I am using now, and getting things working for me. Graph API Explorer was super helpful for me when I was investigatiing this.
var facebookOptions = new Microsoft.Owin.Security.Facebook.FacebookAuthenticationOptions{...};
facebookOptions.Scope.Add("email");
facebookOptions.Scope.Add("user_about_me");
facebookOptions.Scope.Add("user_events");
facebookOptions.Scope.Add("user_groups");
facebookOptions.Scope.Add("user_likes");
facebookOptions.Scope.Add("user_photos");
facebookOptions.Scope.Add("user_videos");
facebookOptions.Scope.Add("user_checkins");
facebookOptions.Scope.Add("user_friends");
facebookOptions.Scope.Add("user_location");
facebookOptions.Scope.Add("user_photo_video_tags");
facebookOptions.Scope.Add("user_actions.music");
facebookOptions.Scope.Add("user_activities");
app.UseFacebookAuthentication(facebookOptions);
I am trying to display YouTube analytics data in a .Net application (Asp.net MVC 4 to be specific) using the google api .net client
The only sample I could find for this was a JavaScript sample located here for the most parts I was able to recreate the code in .Net, The only problem is that I don't seem to be able to find the counterpart for this lines of code which returns a list of Channels for the authenticated user:
var request = gapi.client.youtube.channels.list({
// "mine: true" indicates that you want to retrieve the authenticated user's channel.
mine: true,
part: 'id,contentDetails'
});
which should be then used here in my code:
var request = youtubeAnalyiticsService.Reports.Query(
"channel=="+ channelId, fromDate, toDate,
"views,likes,dislikes" // metrics to include in report
);
What I currently do to get it to work is to copy and paste the channel Id here and therefore "hard-code" it which is not practical in this my case and used only for testing purposes.
Hopefully I'm wrong but after searching for hours I think that the .Net API might be missing this part, can anyone confirm this? and if true are there any alternatives for doing this in the .net application?
I also guess that there might be a straightforward way to just use that part of the JavaScript code in the .net application but I'm not sure how!
Any help, hint or clarification would be much appreciated :)
This should work, assuming you've already got OAuth 2 setup and youtube is a YouTubeService object that's been properly authorized:
ChannelsResource.ListRequest channelsListRequest = youtube.Channels.List("id");
channelsListRequest.Mine = true;
ChannelListResponse channelsListResponse = channelsListRequest.Fetch();
string channelId = channelsListResponse.Items[0].Id;
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.