From 3c22873f981cd5555fcea1a426a7094c271b6eb9 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Sun, 7 Dec 2014 20:58:39 -0800 Subject: [PATCH] added a readme and a command line tool --- README.md | 5 +++++ twitter.go | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..6c08f57 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# twitter intersection + + +Command line program written in [Go](https://golang.org) to get the list of the +followers of two twitter accounts. \ No newline at end of file diff --git a/twitter.go b/twitter.go index fc8a3ee..96673a4 100644 --- a/twitter.go +++ b/twitter.go @@ -2,6 +2,8 @@ package main import ( "fmt" + "log" + "os" "sync" ) @@ -79,9 +81,13 @@ func GetFollowerIdsOfBothAccounts(followerGetter FollowerGetter, screenName1, sc } func main() { + if len(os.Args) != 3 { + log.Println("you need to specify the name of exactly two twitter account names at parameter") + return + } token := "AAAAAAAAAAAAAAAAAAAAAPwfcQAAAAAAzkou%2FHjJNJmwdepeRq0c%2Bi3Nx6o%3DXofLt7SVvc99ulETLRA3yS2lYo8smfc6tACxEYsLUmGsrNbc9J" t := NewTwitterApi(TWITTER_API_URL, token) - followers := Intersection(GetFollowerIds(t, "Shopify"), GetFollowerIds(t, "ShopifyPicks")) + followers := Intersection(GetFollowerIds(t, os.Args[0]), GetFollowerIds(t, os.Args[1])) for screenName := range GetScreenNameByIds(t, followers) { fmt.Println(screenName) }