-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef8c6ab
commit 8f97982
Showing
9 changed files
with
101 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
__all__ = ['animegifs'] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
__all__ = ['animegifs', 'dis_utils'] | ||
|
||
|
||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,64 @@ | ||
import random | ||
import json | ||
from urllib.request import urlopen | ||
|
||
def access(): | ||
url = 'https://github.com/MarcoSa-2000/marcosa-2000.github.io/raw/main/utils/animegifs_project/gifs.json' | ||
response = urlopen(url) | ||
data = json.loads(response.read()) | ||
|
||
attack = data['attack'] #0 | ||
bite = data['bite'] #1 | ||
bloodsuck = data['bloodsuck'] #2 | ||
blush = data['blush'] #3 | ||
bonk = data['bonk'] #4 | ||
brofist = data['brofist'] #5 | ||
cry = data['cry'] #6 | ||
cuddle = data['cuddle'] #7 | ||
dance = data['dance'] #8 | ||
disgust = data['disgust'] #9 | ||
facedesk = data['facedesk'] #10 | ||
facepalm = data['facepalm'] #11 | ||
flick = data['flick'] #12 | ||
flirt = data['flirt'] #13 | ||
handhold = data['handhold'] #14 | ||
happy = data['happy'] # 15 | ||
harass = data['harass'] # 16 | ||
highfive = data['highfive'] # 17 | ||
hug = data['hug'] # 18 | ||
icecream = data['icecream'] # 19 | ||
insult = data['insult'] # 20 | ||
kill = data['kill'] # 21 | ||
kiss = data['kiss'] # 22 | ||
|
||
del data | ||
|
||
return attack, bite, bloodsuck, blush, bonk, brofist, cry, cuddle, dance, disgust, facedesk, facepalm, flick, \ | ||
flirt, handhold, happy, harass, highfive, hug, icecream, insult, kill, kiss | ||
from animegifs.dis_utils import gifs | ||
|
||
class Animegifs(): | ||
|
||
def __init__(self, category=None): | ||
def __init__(self): | ||
self.category = None | ||
|
||
def get_gif(self, category=None): | ||
if category is None: | ||
raise Exception("No category has been specified.") | ||
else: | ||
self.category = category | ||
|
||
def get_gif(self): | ||
if self.category == 'attack' or self.category == 'attacc': | ||
gif = random.choice(access()[0]) | ||
elif self.category == 'bite': | ||
gif = random.choice(access()[1]) | ||
elif self.category == 'bloodsuck': | ||
gif = random.choice(access()[2]) | ||
elif self.category == 'blush': | ||
gif = random.choice(access()[3]) | ||
elif self.category == 'bonk': | ||
gif = random.choice(access()[4]) | ||
elif self.category == 'brofist': | ||
gif = random.choice(access()[5]) | ||
elif self.category == 'cry': | ||
gif = random.choice(access()[6]) | ||
elif self.category == 'cuddle': | ||
gif = random.choice(access()[7]) | ||
elif self.category == 'dance': | ||
gif = random.choice(access()[8]) | ||
elif self.category == 'disgust': | ||
gif = random.choice(access()[9]) | ||
elif self.category == 'facedesk': | ||
gif = random.choice(access()[10]) | ||
elif self.category == 'facepalm': | ||
gif = random.choice(access()[11]) | ||
elif self.category == 'flick': | ||
gif = random.choice(access()[12]) | ||
elif self.category == 'flirt': | ||
gif = random.choice(access()[13]) | ||
elif self.category == 'handhold': | ||
gif = random.choice(access()[14]) | ||
elif self.category == 'happy': | ||
gif = random.choice(access()[15]) | ||
elif self.category == 'harass': | ||
gif = random.choice(access()[16]) | ||
elif self.category == 'highfive': | ||
gif = random.choice(access()[17]) | ||
elif self.category == 'hug': | ||
gif = random.choice(access()[18]) | ||
elif self.category == 'icecream': | ||
gif = random.choice(access()[19]) | ||
elif self.category == 'insult': | ||
gif = random.choice(access()[20]) | ||
elif self.category == 'kill': | ||
gif = random.choice(access()[21]) | ||
elif self.category == 'kiss': | ||
gif = random.choice(access()[22]) | ||
else: | ||
raise Exception("Not a valid category.") | ||
if category == 'attack' or category == 'attacc': | ||
gif = random.choice(gifs.access()[0]) | ||
elif category == 'bite': | ||
gif = random.choice(gifs.access()[1]) | ||
elif category == 'bloodsuck': | ||
gif = random.choice(gifs.access()[2]) | ||
elif category == 'blush': | ||
gif = random.choice(gifs.access()[3]) | ||
elif category == 'bonk': | ||
gif = random.choice(gifs.access()[4]) | ||
elif category == 'brofist': | ||
gif = random.choice(gifs.access()[5]) | ||
elif category == 'cry': | ||
gif = random.choice(gifs.access()[6]) | ||
elif category == 'cuddle': | ||
gif = random.choice(gifs.access()[7]) | ||
elif category == 'dance': | ||
gif = random.choice(gifs.access()[8]) | ||
elif category == 'disgust': | ||
gif = random.choice(gifs.access()[9]) | ||
elif category == 'facedesk': | ||
gif = random.choice(gifs.access()[10]) | ||
elif category == 'facepalm': | ||
gif = random.choice(gifs.access()[11]) | ||
elif category == 'flick': | ||
gif = random.choice(gifs.access()[12]) | ||
elif category == 'flirt': | ||
gif = random.choice(gifs.access()[13]) | ||
elif category == 'handhold': | ||
gif = random.choice(gifs.access()[14]) | ||
elif category == 'happy': | ||
gif = random.choice(gifs.access()[15]) | ||
elif category == 'harass': | ||
gif = random.choice(gifs.access()[16]) | ||
elif category == 'highfive': | ||
gif = random.choice(gifs.access()[17]) | ||
elif category == 'hug': | ||
gif = random.choice(gifs.access()[18]) | ||
elif category == 'icecream': | ||
gif = random.choice(gifs.access()[19]) | ||
elif category == 'insult': | ||
gif = random.choice(gifs.access()[20]) | ||
elif category == 'kill': | ||
gif = random.choice(gifs.access()[21]) | ||
elif category == 'kiss': | ||
gif = random.choice(gifs.access()[22]) | ||
elif category == 'lick': | ||
gif = random.choice(gifs.access()[23]) | ||
else: | ||
raise Exception("Not a valid category. You can check valid categories at: https://github.com/MarcoSa-2000/animegifs") | ||
return gif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
# __init__.py | ||
__all__ = ['infoes.py'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import json | ||
import requests | ||
|
||
def access(): | ||
data = requests.get("https://objectstorage.eu-frankfurt-1.oraclecloud.com/p/zDPowf1lXXMMpXzo_Lnb31IOtUyxrtD-kDS7fpKxLuCYnR5xr-171Tyz0tW0EhKV/n/frqs54dqeajn/b/animegifs_lib/o/gifs.json").content | ||
data = json.loads(data) | ||
|
||
attack = data['attack'] #0 | ||
bite = data['bite'] #1 | ||
bloodsuck = data['bloodsuck'] #2 | ||
blush = data['blush'] #3 | ||
bonk = data['bonk'] #4 | ||
brofist = data['brofist'] #5 | ||
cry = data['cry'] #6 | ||
cuddle = data['cuddle'] #7 | ||
dance = data['dance'] #8 | ||
disgust = data['disgust'] #9 | ||
facedesk = data['facedesk'] #10 | ||
facepalm = data['facepalm'] #11 | ||
flick = data['flick'] #12 | ||
flirt = data['flirt'] #13 | ||
handhold = data['handhold'] #14 | ||
happy = data['happy'] # 15 | ||
harass = data['harass'] # 16 | ||
highfive = data['highfive'] # 17 | ||
hug = data['hug'] # 18 | ||
icecream = data['icecream'] # 19 | ||
insult = data['insult'] # 20 | ||
kill = data['kill'] # 21 | ||
kiss = data['kiss'] # 22 | ||
lick = data['lick'] # 23 | ||
|
||
del data | ||
|
||
return attack, bite, bloodsuck, blush, bonk, brofist, cry, cuddle, dance, disgust, facedesk, facepalm, flick, \ | ||
flirt, handhold, happy, harass, highfive, hug, icecream, insult, kill, kiss, lick | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requests==2.28.2,<=2.29.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters