logging in using twitter api in C# - c#

I am developing an application in which I will supply my twitter username and password to login to twitter account.I had seen twitter API's ,But that wouldn't helped me out because none of them contains any executable code on Visual studio.The .sln files are also not working.Anyone who can help me in providing a sample code.
Thank you in meekness

This article on CodeProject should set you in the right direction.
http://www.codeproject.com/Articles/247336/Twitter-OAuth-authentication-using-Net
Here is another good article on setting up your Twitter authentication as well.
http://www.voiceoftech.com/swhitley/index.php/2009/03/twitter-oauth-with-net/

Take a look at this turtorial C# Twitter Client
HTH.

Related

Automatically share new updates on my website to social networks?

Is there any way to update my social networks automatically from my own website admin panel?
Let's say I add a new article and I want to save it to my database and share it to my Facebook page and Twitter. Is there any code to do this? Has anyone made it before?
Please see the following CodeProject article for full instructions:
C# Application Integration with Facebook & Twitter with oAuth
Facebook:
var fb = new FacebookClient(this.AccessToken);
string wallPost = "Your programmatic wall post using Facebook C# SDK";
dynamic result = fb.Post("me/feed", new { message = wallPost });
Twitter:
string tweetMessage = "Your programmatic Tweet using TweetSharp library"
TwitterStatus twitterStatus = twitterService.SendTweet(tweetMessage);
References:
Facebook Developer Documentation
Facebook SDK
Twitter Developer Documentation
TweetSharp Library
I understand it's customary in StackOverflow answers to include a summary of the contents of a link or the highlights that specifically answer the question. And with a link-only answer, people must dig through another resource to locate an answer they might not be sure about and most importantly, if the link were to ever break, my answer is useless for anyone who visits this page in the future. However MSDN, Code Project, GitHub are generally acceptable links so I'm am not copying the entire article.
Check developer guides for twitter and facebook on how to integrate them. There are also c# sdks for both platforms available on NuGet: TweetSharp and facebook
Like already was said above have a look at the SDK's on the developers website(s)
or
Have a look at Twitterfeed.com, this website will allow you to provide a RSS feed with the latest (news,updates) and submits them automatically to Twitter, Facebook, linkedin etc
Simply generate an rss feed with your latest changes, provide it to twitterfeed.com and they do the rest

Google Account login Integration for android Xamarin

I need to integrate google login to android xamarin application.
gone through the code from bellow link:
http://motzcod.es/post/67077106339/google-plus-services-login-and-1-in-xamarin-android
it shows the error connection failed and [GooglePlayServicesUtil] Google Play Store is missing.
even ofter adding google play service(Froyo) component.
even i gone through the bellow links
https://developers.google.com/+/mobile/android/sign-in
Android: Login using google account?
Google Login For Android App
but this is related to android eclipse using java code.
can anybody suggest me how to do this in xamarin. any hints/links are appreciated.
thank you.
Finally i got a solution by doing the research over the available codes from xamarin forum and stackoverflow.
I made use of the OAuth2Authenticator
Register in google developer console as webapplication instead of installed application(android)* provide the redirect url with valid url ("http://abcd.com/xyz.aspx") same should be used in the application code.
On authentication complete it will return access_token
By using the access_token make the REST request to get user complete information (https://www.googleapis.com/oauth2/v1/userinfo?access_token=" + accessTokenValue + “.)
Deserialize the json response to get information in object.
*If we registered in developer console as installed application(like
android) after making OAuth2Authenticator request it will show window
with message please copy this code switch to your application and
paste it there [code] manually need to close the window and proceed
to authentication. to get ride of this webapplication type is choosen.
Refer for more info. : Login by google account integration for Xamarin.Android and Xamarin.iOS
The answer given is great. It works without trouble so long as that redirecturi is a real and accessible url for the underlying WebView to connect to at the end of the flow. In a mobile scenario this really doesn't make sense but google requires it. The examples typically say use localhost as the redirecturi which leads to a 401 UnAuthorized response showing in the UI. Ugh. Authentication is successful, but you have this ugly box you have to click on.
My solution on this was to have the redirecturi be the me link, https://www.googleapis.com/plus/v1/people/me. The code you have completes, there are no errors and the view is dismissed. Hope this helps somebody.

is oAuth possible for C# Windows Application?

I have a windows application, developed in C#. where I need to perform Google oAuth so I'll get their profile. I don't want to ask the user to enter their Google Username and Password in my windows application (and of course users don't want that).
How can I do that ?
I tried
1.) Able to open Google Authentication page from my windows application, but can't figure it out how to get access token passed to my windows application.
Any inputs / suggestions ?
You can have a webBrowser control in you application. You can then let the user log in via the webBrowser control. You can then query the webBrowser control for the data.
What you are probably looking for is called 2-legged OAuth. You can get some example code here, but its in PHP. You can also see a C# Example here
I appreciate this is an old question but I'm currently looking into the same thing. From what I've found, using an embeded webBrowser as per SamFisher83's suggestion is "strongly discouraged".
I thought I'd share this guide from Google themselves.
Link to Google OAuth 2.0 guide
No doubt the OP found a way of doing it, but this was one of the first links that came up via a google search on the subject and thought I'd share the link for any future reference.

Update facebook status with C#

My desktop application should update my facebook status.
Is there an API that allows to update the status with a login and pwd ?
Thanks in advance for your answer
Sure there is!
.Net FacebookToolKit it was done by a 3rd party for Microsoft, and then published as open source on CodePlex.
There is proper documentation and even videos on how to do your first desktop application and how to publish stories, status, etc.
FaceBookToolKit CodePlex documentation
Facebook Send User Status
There is the Status.set API that allows you to do this kind of thing.

Simple Facebook Connect Demo in ASP.NET

Does anyone have a simple and successful demo implementation of facebook connect in an asp.net application. I am developing an asp.net web application and want facebook connect to be the primary method for logging in.
I was having troubles as well, but found that this stackoverflow question got me on the right track as far as the server side stuff is concerned
However, First you have to get the facebook connect button working from here Facebook Wiki
Then detect if they are logged in or not and redirect them appropriately to a welcome page.
Detect login via Javascript
Most other actions can be done via serverside with the Facebook ToolKit. (eg get their information, friends, etc..)
The last thing I think I should mention is logging the user out, so take a look at this. Facebook Wiki: Logout
Hope this helps
As I see, all the above examples and links are really outdated. The new Facebook Graph API makes the whole process a lot easier, without the need for any other components:
http://area72.ro/general-it/how-to-login-via-facebook-in-asp-net.html
try to use the toolkit called Facebook Developer Toolkit
you have in Steve Blog a post about it, and you even download he's Starter Kit so you can view all the code :)
Hope it helps
I know you asked for ASP.NET resources. The Facebook Connect page provides some good information as well as the source to a sample implementation using PHP. Hopefully you can pull some good information from the PHP code.
http://developers.facebook.com/connect.php Check out the links on the right side.
The provided demo can be accessed here... http://www.somethingtoputhere.com/therunaround/

Categories