Skip to content

Instantly share code, notes, and snippets.

@jz5
Created Aug 31, 2015
Embed
What would you like to do?
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