jabbalaci / Bash-Utils

Miscellaneous small utils, mainly for the Bash shell.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

init on reddit.

jkbbwr opened this issue · comments

reddit_get_posts.py

Do you really need an init function that globals a variable?

In fact you use way to many global statements in there. Why?

The init() function adds the '/.json' string to DEFAULT_REDDIT. This way you don't need to bother about the detail that we want to access the JSON API of reddit, this thing is somewhat hidden.

REDDIT is global in verify_arguments() because we need to add '/.json' again if the user specified a custom subreddit (instead of the default one).

Maybe WHAT_TO_GET could be eliminated in main().