This repository was archived by the owner on Mar 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ksk001100/toyotter
- Loading branch information
Showing
13 changed files
with
161 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package commands | ||
|
||
import ( | ||
"net/url" | ||
|
||
"github.com/ChimeraCoder/anaconda" | ||
"github.com/KeisukeToyota/toyotter/twitter" | ||
"github.com/urfave/cli" | ||
) | ||
|
||
// ListCommand list command function | ||
func ListCommand(a *anaconda.TwitterApi, val url.Values) cli.Command { | ||
api = a | ||
v = val | ||
return cli.Command{ | ||
Name: "list", | ||
Aliases: []string{"li"}, | ||
Usage: "toyotter list [...option]", | ||
Flags: listFlags(), | ||
Action: listAction, | ||
} | ||
} | ||
|
||
func listFlags() []cli.Flag { | ||
return []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: "count c", | ||
Value: "10", | ||
Usage: "toyotter list --count=[count]", | ||
}, | ||
} | ||
} | ||
|
||
func listAction(c *cli.Context) error { | ||
twitter.Lists(api, v) | ||
return nil | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package twitter | ||
|
||
import ( | ||
"fmt" | ||
"net/url" | ||
|
||
"github.com/ChimeraCoder/anaconda" | ||
"github.com/KeisukeToyota/toyotter/modules" | ||
) | ||
|
||
// Lists lists function | ||
func Lists(api *anaconda.TwitterApi, v url.Values) { | ||
user, _ := api.GetSelf(v) | ||
lists, err := api.GetListsOwnedBy(user.Id, v) | ||
|
||
if err != nil { | ||
modules.ErrorMessage("Get lists failed") | ||
} | ||
|
||
for _, list := range lists { | ||
fmt.Println(modules.GetFormatList(list)) | ||
} | ||
} |
This file contains 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
This file contains 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