Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
4 changes: 4 additions & 0 deletions garc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
"""
Expand Down
3 changes: 3 additions & 0 deletions garc/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'user',
'userposts',
'usercomments',
'statuses',
'top'
]

Expand Down Expand Up @@ -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()
Expand Down