Automatically share new updates on my website to social networks? - c#

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

Related

Facebook JS SDK + C# SDK Logic

I've been playing around with Facebook JavaScript SDK and Facebook SDK for .NET (Web) to try and create a simple Page tab app which does the below:
Show welcome page
If user likes the page, ask for proper extended permissions and redirect to another page reserved for fans only
Use the access token from the login to do things on the user behalf.
Anyway, my problem is with the logic of the whole thing, as the user enters the page what should I do after loading the JS SDK? It automatically shows the permissions box so that I could get the extended permissions user_likes instead of showing the welcome page.
My other issue is with the access token that is going to be used later in time. Should i store it in session state? if yes, how? What happens if i try to access it and it's expired?
I know this is a general question but please could someone guide me through the best practices to initialize and use the facebook SDK in a .NET WebForms tab app?
Thanks a lot.
(I've read through both docs on Facebook and C# SDK. Great for browsing the API but not much documentations or examples about .NET WebForms)

logging in using twitter api in 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.

Traversing Connections through the Facebook C# API

I am attempting to write an application that harvests information from a logged-in Facebook user. We are using the Facebook C# API (some documentation here). Getting the basic user information is easy enough, but the Graph API supports a lot of connections that link their objects to other arrays of things, which are all important for the application I'm writing. I am unable to find an example on how to traverse these connections on the codeplex site. Can anyone provide an example? Normally I would use the site itself but the discussion page outright requests that question askers use Stack!
Here is a sample code on how to use the feeds connection.
var fb = new FacebookClient("access_token");
dynamic result = fb.Get("/me/feeds");
You don't specify much about your application. If this is more of an IT thing than a true "Facebook Application", you could automate using PowerShell with Facebook PS Module.

ASP.NET MVC3 and Facebook integration

I'm just about to start a new ASP.NET project using MVC3, and since some of the requirements are about facebook integration, I need your advice on the following issues:
1- Is it achievable to connect my Membership users to thier Facebook accounts so whenever a user share/add/comment on an event on my website, I can automatically share these actions using his/her Facebook account?
2- also the ability to create Facebook events when the user create one on my site, and if he/she updates the event information, I may update them on Facebook too.
3- Can this be achieved using Facebook Connect, or this is only to authenticate users using their Facebook accounts?
4- How about using Graph API from my MVC solution, I know that there is a Facebook C# SDK on Codeplex http://facebooksdk.codeplex.com, but will it satisfy my mentioned needs or not.
Thanks in advance.
I've done something similar recently. Based on my experience:
Yes, you can connect your membership with a Facebook account, however it does not guarantee your user activity will be pushed to Facebook. (users have to log in with Facebook authentication)
Same as above. This blog post does a good job of describing it: http://amirrajan.net/Blog/asp-mvc-and-facebook-single-sign-on
No, facebook connect only takes care of authentication. For more information, check: http://thinkdiff.net/facebook/graph-api-javascript-base-facebook-connect-tutorial/
I have not tried the Facebook SDK you mentioned. However, I believe facebook Graph API already does a good job for you to and will fulfil your requirement

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