Twitter的API应用程序的唯一身份验证(带linq2twitter)

编程入门 行业动态 更新时间:2024-10-25 21:23:52
本文介绍了Twitter的API应用程序的唯一身份验证(带linq2twitter)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要实现Twitter的API应用程序唯一的身份验证,我已经通过linq2twitter OAuth的样品以及StackOverflow的问题,但我没有发现任何关于它的帮助。

I need to implement Twitter API application-only authentication and I've searched through linq2twitter oauth samples and stackoverflow questions, but I didn't find anything helpful about it.

是否有可能实现这种与linq2twitter如何授权?

Is it possible to implement this kind of authorization with linq2twitter and how?

推荐答案

当然是。这里有一个例子:

Sure is. Here's an example:

var auth = new ApplicationOnlyAuthorizer { Credentials = new InMemoryCredentials { ConsumerKey = "twitterConsumerKey", ConsumerSecret = "twitterConsumerSecret" } }; auth.Authorize(); //auth.Invalidate(); var twitterCtx = new TwitterContext(auth); var srch = (from search in twitterCtx.Search where search.Type == SearchType.Search && search.Query == "LINQ to Twitter" select search) .SingleOrDefault(); Console.WriteLine("\nQuery: {0}\n", srch.SearchMetaData.Query); srch.Statuses.ForEach(entry => Console.WriteLine( "ID: {0, -15}, Source: {1}\nContent: {2}\n", entry.StatusID, entry.Source, entry.Text));

有在下载的源$ C ​​$ C的LinqToTwitterDemo项目运行的例子。 Program.cs文件具有唯一的应用程序的选项。还有,有一个例子的OAuthDemos.cs文件

There are running examples in the LinqToTwitterDemo project of the downloadable source code. The Program.cs file has an option for Application Only. There's also an OAuthDemos.cs file that has an example.

更多推荐

Twitter的API应用程序的唯一身份验证(带linq2twitter)

本文发布于:2023-11-26 16:47:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634422.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   身份验证   Twitter   API   linq2twitter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!