Revert "Dynamically get urls from hipchat. No need for repo-based images!"
This reverts commit 6cde8ec785
.
BIN
assets/acceptable.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/allthethings.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
assets/angrycat.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
assets/areyoukiddingme.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/argh.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/atom.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/awesome.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
assets/awthanks.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/aww.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/awyeah.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
assets/badass.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/beer.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
|
@ -1,11 +1,8 @@
|
|||
import json, requests
|
||||
import json
|
||||
from glob import glob
|
||||
from lxml import html
|
||||
from collections import namedtuple
|
||||
|
||||
CUSTOM_ASSETS_URL="https://raw.githubusercontent.com/RealOrangeOne/hipchat-emoticons-for-all/master/assets/"
|
||||
ASSETS_URL="https://raw.githubusercontent.com/RealOrangeOne/hipchat-emoticons-for-all/master/assets/"
|
||||
|
||||
Emoticon = namedtuple('Emoticon', ['ident', 'url'])
|
||||
|
||||
def get_icon_name(path):
|
||||
return get_filename(path).replace('.png', '').replace('.gif', '')
|
||||
|
@ -14,23 +11,11 @@ def get_filename(path):
|
|||
return path.replace('assets/', '')
|
||||
|
||||
|
||||
page = requests.get("https://www.hipchat.com/emoticons")
|
||||
html_tree = html.fromstring(page.text)
|
||||
emoticon_paths = html_tree.xpath("//div[@class='emoticon-block']/img/@src")
|
||||
emoticon_names = html_tree.xpath("//div[@class='emoticon-block']/div/text()")
|
||||
|
||||
|
||||
emoticons = []
|
||||
for i in range(len(emoticon_names)-1):
|
||||
emoticons.append(Emoticon(emoticon_names[i][1:-1], emoticon_paths[i]))
|
||||
|
||||
images = []
|
||||
for emoticon in emoticons:
|
||||
images.append({emoticon.ident: emoticon.url})
|
||||
|
||||
files = glob('assets/*.png') + glob('assets/*.gif')
|
||||
images = []
|
||||
|
||||
for filename in files:
|
||||
images.append({get_icon_name(filename): CUSTOM_ASSETS_URL + get_filename(filename)})
|
||||
images.append({get_icon_name(filename): ASSETS_URL + get_filename(filename)})
|
||||
|
||||
|
||||
image_decoder = {"images":images}
|
||||
|
|
BIN
assets/bullshirt.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/challengeaccepted.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/chompy.gif
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
assets/content.png
Normal file
After Width: | Height: | Size: 1,012 B |
BIN
assets/doge.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
assets/donotwant.gif
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
assets/drool.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/evilburns.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/facepalm.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
assets/greenbeer.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
assets/herp.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
assets/hubot.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/iseewhatyoudidthere.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/jackie.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/llama.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
assets/lol.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
assets/metal.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
assets/mindblown.gif
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
assets/mygoditsfullofstars.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
assets/nice.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
assets/noot.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
assets/notbad.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/nothingtodohere.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
assets/ohcrap.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/ohgodwhy.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
assets/ohmy.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/okay.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
assets/poo.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/ragegirl.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
assets/rageguy.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
assets/sadpanda.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/sadtroll.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/shipit.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
assets/shrinkray.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
assets/smug.gif
Normal file
After Width: | Height: | Size: 972 B |
BIN
assets/stare.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/sweetjesus.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/troll.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
assets/truestory.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
assets/unacceptable.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
assets/waiting.gif
Normal file
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/wat.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/wooow.gif
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
assets/yey.png
Normal file
After Width: | Height: | Size: 2.1 KiB |