Background app to monitor Facebook - c#

I'm building an aggregator for Twitter and Facebook. Via my website users should be able to grant the app access to their Facebook and Twitter profile.
Then, my C# app will, at regular intervals, check the networks (or stream from) for new posts/likes/tweets related to that user and store the result in a database. I will not use Facebook and Twitter as an identity provider for my website.
Now my question: what library should I use best to accomplish the connection with the social networks? Can I use dotnetopenauth for this? Or are there better solutions?
I should also be able to extend the library and add whatever social network later on.
It is probably a very basic question, but I get confused due to all the possible libraries and options. I tweaked a small and simple OAuth class to connect to Twitter, but this was only capably of OAuth 1.0...

Yes, DotNetOpenAuth can help you with this. But you might want to double check the Facebook terms of service, as I thought they forbade any persistence of the data you download from them.

It is indeed possible to do so with DotNetOpenAuth, I know this because I am working on something similar. Already have it working like a charm with Twitter, working on the Facebook link at the moment. Seems like Facebook is going to give me more trouble then I expected at first.

Related

List launcher apps from Office365

We are looking to create our own "My apps" From Office365 to create a launcher.
We currently use microsoft.graph for other functionalities (like authorization) but I don't see a way to get my tenants available apps.
Using getSubscribedSkus and the users's assignedPlans / assignedLicenses we can figure it out, but that shows nothing about pinned tiles, images, urls etc.
Is there another way to get this done?
Thanks!
There is an Applications API in preview under /beta: https://graph.microsoft.com/beta/applications. The API is documented here: https://graph.microsoft.io/en-us/docs/api-reference/beta/resources/application
We currently use microsoft.graph for other functionalities (like authorization) but I don't see a way to get my tenants available apps.
As far as I know, there is no API to achieve this so far. You may consider submitting a User Voice on https://officespdev.uservoice.com.

Google ClientLogin Authorization and Google Music

I am playing around with Google Music. I'm trying to see if I can write an app that will stream my music files uploaded to Google Music. So far, I've managed to authenticate myself using ClientLogin and access the music.google.com page. However, whenever I try to access http://music.google.com/music/services/loadalltracks, the page that contains all of my tracks in JSON format, I get a 401: Unauthorized error. However, if I pass the cookies containing SID and HSID, it works and I can access the page.
Does anyone know why It doesn't work with ClientLogin, outside of Google not supporting it with Music? Have you had similiar experience with other Google Services? In the event I can't get ClientLogin to work, is there anyway to work around it, using the SID? I don't know how the HSID is generated.
Since there is no official api for Google Music, you need full SSO credentials to use those endpoints. The easiest way to do this is to emulate a browser (with eg mechanize).
The way my unofficial Google Music api accomplishes this is a bit cleaner, but more work: use clientlogin to authenticate to the Music Manager service, then upgrade those credentials using tokenauth. This isn't really a public feature, but it's described by a third party here, and by a Google design doc here. The specific endpoints you need are in my code here (in clientlogin.py and tokenauth.py).
You'll want to send u=0 and xt=[value of xt cookie] in the querystring as well. The first argument specifies which account you're using (if you're signed into multiple), and the second is a xsrf token.
Well, as far as I can tell the reason sending the SID and HSID cookies makes the request work is because you're simulating the way a normal user is accessing the service.
You can't go the regular application way because that's not supported in google music (as far as my internet research showed, there's no API for google music).
Oh, and one thing: google discourages people from using ClientLogin and instead tells people to use OAuth ("ClientLogin [is] Google's proprietary authorization API ... you should avoid using [this] service." found at http://code.google.com/apis/gdata/docs/auth/overview.html) so in the future you might want to use that. Maybe it'll even work in this case (It sends a different token from ClientLogin - OAuth token instead of an Auth token) though I doubt that.
Anyway, I hope this cleared things up.

Is it possible to login to multiple facebook accounts? (C# 4.0)

I am creating a small desktop application, which would ideally allow multiple facebook users to log in. After they play a game (on one machine), I'd like to be able to individually post their status to their Facebook accounts. This is possible if there is just a single user, but multiple users are causing problems with Sessions and so on. Can anyone advise a way to get around this? Thanks!
To better answer your question, it would help to know how exactly you're connecting to Facebook from your game software.
In general, if you're using OAuth tokens to do it, try keeping separate sets of access tokens and pass along each one when appropriate.

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

Twitter integration and authentication

I am writing an app using WPF 3.5 and I need twitter integration.
I know that there are many API's for C# and most of them seem to be on the right track.
But one, painfully annoying (seemingly 100% required) step of the twitter posting is that you need to redirect the user to the twitter website, in which they need to login and click "allow" which then shows a PIN number which the user must enter in to my client app in order to simply tweet.
This is so cumbersome and annoying for each run of the app, I dont mind a once off thing, but each time?? Am I not doing this right, why isnt it just a once off allowance of a registered app? How do apps like TweetDeck do it so that they dont have to re-approve each time I load the app?
You need to store the token and the key provided by the server when you perform the OAuth authentication. You can continue to sign your requests using those keys. I'm not entirely sure which library you're using, which makes it hard to say, but there should be a means of retrieving the key/token that Twitter provides you with and passing this back in as a means of authentication.
One other alternative is to use xAuth, which makes it a little easier for your app to authenticate the user. The downside is that it's pretty oblique and might not be supported by the library you're using.
Good luck!

Categories