Created
August 31, 2015 02:13
-
-
Save jz5/92b7aa688c073761993a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Module Module1 | |
Sub Main() | |
#Region "keys" | |
Dim consumerKey = "***" | |
Dim consumerSecret = "***" | |
Dim accessToken = "***" | |
Dim accessSecret = "***" | |
#End Region | |
Dim tokens = CoreTweet.Tokens.Create(consumerKey, consumerSecret, accessToken, accessSecret) | |
' API GET followers/ids (5000人までフォロワーの ID を取得) | |
Dim idsResult = tokens.Followers.Ids(New Dictionary(Of String, Object) From { | |
{"screen_name", "jz5"}}) | |
Dim count = 0 | |
For i = 0 To Math.Floor(idsResult.Count / 100) | |
Dim ids = idsResult.Skip(i * 100).Take(100) | |
' API GET users/lookup (100人ごとにユーザー情報を取得) | |
Dim lookupResult = tokens.Users.Lookup(New Dictionary(Of String, Object) From { | |
{"user_id", ids}}) | |
For Each u In lookupResult | |
If u.Name.Contains("友利奈緒") Then ' 友利奈緒を探す | |
count += 1 | |
Console.WriteLine("{0} {1}", u.ScreenName, u.Name) | |
End If | |
Next | |
Next | |
tokens.Statuses.Update(String.Format("フォロワーに友利奈緒を{0}人見つけました #pronama", count)) | |
End Sub | |
End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment