diff --git a/README.md b/README.md index 20ecac4..7f658ff 100644 --- a/README.md +++ b/README.md @@ -88,4 +88,12 @@ You can collect the "top posts" of the day, week, month, or year: garc top monthly garc top yearly -This will return the top 15 or so posts that day. \ No newline at end of file +This will return the top 15 or so posts that day. + +### Statuses + +You can retrieve a single post by its ID: + + garc statuses 106525740881070143 + +This will return Andrew Torba's current pinned Gab. diff --git a/garc/client.py b/garc/client.py index 16937c7..b3a98d5 100755 --- a/garc/client.py +++ b/garc/client.py @@ -163,6 +163,10 @@ def top(self, timespan=None): resp = self.anonymous_get(url) return resp.json() + def statuses(self, q): + url = "https://gab.com/api/v1/statuses/%s" % (q) + resp = self.get(url) + yield resp.json() def userposts(self, q, gabs=-1, gabs_after='2000-01-01'): """ diff --git a/garc/command.py b/garc/command.py index d6e1c05..49cf65d 100755 --- a/garc/command.py +++ b/garc/command.py @@ -26,6 +26,7 @@ 'user', 'userposts', 'usercomments', + 'statuses', 'top' ] @@ -101,6 +102,8 @@ def main(): ) elif command == 'top': things = g.top(timespan=query if query else None) + elif command == 'statuses': + things = g.statuses(query) else: parser.print_help()