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.
Related
I am sharing my page "www.mysite.com/detail/?v=2442411" to linkedIn but I just get a "Oops" on linkedIn.
In code I have it like this:
string LinkedIn = $"https://www.linkedin.com/shareArticle?mini=true&url={mysiteurlvariable}?v={myidvariable}&title=ThisTitle"
It spits out this link:
https://www.linkedin.com/shareArticle/?mini=true&url=www.mysite.com/detail/?v=2442411&title=ThisTitle
When following the link as I say I just get a oops from LinkedIn.
Although when replacing the url with any other url also without a parameter its fine.
It seems like it does not like the ?v={myidvatiable} part
Anyone know of this issue or why this is an issue
You need to do URL-encoding with parameters you are feeding to another URL. And also, since you have posted your question, the LinkedIn Share URL parameters have changed. Source: Official Microsoft LinkedIn Share URL Documentation.
So, this is what you should want...
https://www.linkedin.com/sharing/share-offsite/?url={mysiteurlvariable}%3Fv%3D%7Bmyidvariable%7D%26title%3DThisTitle%22
Hope this helps!
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
I know you have to make a POST request, but I have no idea how to. I have searched the web but found nothing about this. Thanks in advance.
Steam API docs available here: https://steamcommunity.com/dev
In particular DeclineTradeOffer method: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService#DeclineTradeOffer_.28v1.29
E.g.
http://api.steampowered.com/IEconService/DeclineTradeOffer/ including the tradeofferid in the POST data.
I just want to know if there is a naming standard on REDIRECT URIS for :
Twitter, LinkedIn, Microsoft, Facebook and Google when using OAuth 2.0?
Because, if I write my domain like that : http://domain.com/account/external-signin.aspx every external login stop working except Twitter and Facebook. The name account/external-signin.aspx is the real URL I'm working with and that I'm supposed to give to every external login.
So, Microsoft give this error:
We're unable to complete your request
Microsoft account is experiencing technical problems. Please try again later.
LinkedIn:
Invalid redirect_uri. This value must match a URL registered with the API Key.
And Google
400. That’s an error. Error: redirect_uri_mismatch
If I remove the page extension .aspx it seems to work although I deliberately write a wrong url like http://domain.com/sign-google, http://domain.com/sign-microsoft etc...
I'm working with MVC5 and C#.
I think I missed a few things ...
Thanks for your help
So finally, here is the correct answer:
It's not you that choose the redirect URL. You must write your domain.com/signin-{suppliername} in your app management.
Example:
Microsoft : https://domain.com/signin-microsoft
LinkedIn : https://domain.com/signin-linkedin
Google : https://domain.com/signin-google
Facebook and Twitter can work with your own redirect URL. Once successfully registered, the effect is immediate. Hope this can help somebody.
Karine
This error is denoting that you're having a miss match with the URL you're returning, and the return URL registered at the API Server. When you register your application, at the server, (for Google: https://code.google.com/apis/console) you have to make sure that the URLs being used would be matching.
After this, you will not get this error, I think on the server you've set this property to, http://domain.com/account/external-signin (without aspx; as you've said that this works without the extension but not with it). So try to change it on the server too.
For Linkedin append your url with "signin-linkedin".e.g. if your url is http://localhost:{portnumber}, make sure its is register in linked in as "http://localhost:{portnumber}/signin-linkedin" and this will do the trick.
Happy Codding :)
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.