1
0
Fork 0
Commit Graph

18 Commits

Author SHA1 Message Date
Lucidiot bac5dde8b5
Do not crash on missing token 2022-07-20 10:30:47 +02:00
Lucidiot 75f3e2220e
Fix API token fetching 2022-07-20 10:18:32 +02:00
afik_cohen 68ecaab488 Accept dirs as well as single files on cmdline, and also accept api_token via input if scraping it fails. 2020-05-15 16:25:06 -07:00
Charlie Schluting edf0dd3a9c honor HTTP retry-after header for better success 2019-09-04 12:54:14 -05:00
Denbeigh Stevens fdd77eb853 added exponential backoff for rate limiting 2019-09-02 11:40:30 -07:00
Denbeigh Stevens 0d773f2d68 fixed scraping for slack ui changes, improve failure messaging 2019-09-02 11:04:49 -07:00
matsu-chara 48cc567b80 remove redundunt logs 2018-08-28 14:33:14 +09:00
matsu-chara 415ab46398 update upload.py for slack new ui 2018-08-28 14:31:27 +09:00
Arun Babu Neelicattu 60aa4c8653 Support emoji name prefix/suffix
- add support for prefixes via --prefix/$EMOJI_NAME_PREFIX
- add support for suffixes via --suffix/$EMOJI_NAME_SUFFIX
2017-07-25 01:34:51 +12:00
Sergey Zhilin fffc1ac8b0 A little fix to upload.py
get_current_emoji_list function had a greedy quantifier in regexp: "data-emoji-name=\"(.*)\""
I.e. for string like
`data-emoji-name="parrot" data-action="emoji.remove"`
it returns following result:
`parrot" data-action="emoji.remove`

In case of lazy quantifier ("data-emoji-name=\"(.*?)\"") the result will be correct:`parrot`
2017-05-18 16:07:16 +03:00
Sam Stavinoha 8380a341f7 refactor to use argparse and fewer globals 2016-12-08 14:39:20 -08:00
Sam Stavinoha 150980c9b5 make upload.py executable 2016-12-08 13:40:58 -08:00
Sam Stavinoha 88818c048e dont eval input on py2
In python2, `input(p)` is equilvalent to `eval(raw_input(p))`,
but raw_input is not defined in python 3. So let's use raw_input
if it's there, and fall back to `input` otherwise (otherwise
probably just means python3.)

This change fixes the following outcome in python2.x :

$ python upload.py -h
Please enter the team name: helloworld
Traceback (most recent call last):
  File "upload.py", line 15, in <module>
    team_name = input("Please enter the team name: ")
  File "<string>", line 1, in <module>
NameError: name 'helloworld' is not defined
2016-12-08 13:39:44 -08:00
Vadim Markovtsev 95e7e3df59 Improve the script
1. Add Python 3 (bytes) and 3.5 support (bs4)
2. Allow setting SLACK_* interactively
3. Do not stop uploading in case of errors
4. Fix "already exists" misprint
2016-09-26 00:37:40 +02:00
Kyle Varga f36c666970 Refactoring, check if emoji exists before uploading, and improved error handling 2016-07-31 12:26:08 -05:00
Ash Wilson d574b713cc Fetch the form to generate a crumb. 2015-02-24 21:57:48 -06:00
Ash Wilson 8caaee1296 emoji_name shouldn't contain the extension. 2015-02-24 21:57:25 -06:00
Ash Wilson 91d1f70d38 Initial work. 2015-02-22 11:29:55 -05:00