<jupyter_start><jupyter_text>wcm pokmonscript to explore the pokemon api and get gifs.<jupyter_code>import requests
import json
import shutil
reqg = requests.get('http://pokeapi.co/api/v1/pokedex/1/')
retxt = reqg.text
pokload = json.loads(retxt)
allpok = len(pokload['pokemon'])
print(pokload['pokemon'][200])
allpok
opwritj = requests.get('http://api.giphy.com/v1/gifs/search?q=' + (pokload['pokemon'][alpo]['name']) + '&api_key=<KEY>')
for alpo in range(allpok):
    print(pokload['pokemon'][alpo]['name'])
    opwritj = requests.get('http://api.giphy.com/v1/gifs/search?q=' + (pokload['pokemon'][alpo]['name']) + '&api_key=<KEY>')
    wrijrd = opwritj.text
    jswri = json.loads(wrijrd)
    jswln = len(jswri['data'])
    for jsw in range(0, jswln):
        if '.gif' in jswri['data'][jsw]['images']['downsized']['url']:
            print(jswri['data'][jsw]['images']['downsized']['url'])
            response = requests.get((jswri['data'][jsw]['images']['downsized']['url']), stream=True)
            with open('/home/wcmckee/Downloads/gify/' + (pokload['pokemon'][alpo]['name']) + str(jsw) + '.gif', 'wb') as out_file:
                shutil.copyfileobj(response.raw, out_file)
                del response<jupyter_output>rattata
http://media1.giphy.com/media/vXkfATtZmC26Q/giphy.gif
http://media0.giphy.com/media/IrMkKlhZy4hri/giphy.gif
http://media4.giphy.com/media/jeWqeTeBS03WE/giphy.gif
http://media3.giphy.com/media/NN4fvJBKKvrnq/giphy.gif
http://media2.giphy.com/media/A3LyV2yV5r5cI/giphy.gif
http://media1.giphy.com/media/6obZXFnopj9vy/giphy.gif
http://media4.giphy.com/media/CZgC0EiQhwiM8/giphy.gif
http://media2.giphy.com/media/10oCqxckv42wlq/giphy.gif
http://media4.giphy.com/media/OZnzDqIzdduuY/giphy.gif
charmander
http://media2.giphy.com/media/PiiQ5B1XxxiX6/giphy.gif
http://media3.giphy.com/media/V4sY8JCTxGyaI/giphy.gif
http://media1.giphy.com/media/fJXClS1SskWPu/giphy.gif
http://media2.giphy.com/media/11agp3tD5MPgnC/giphy.gif
{'fraction_non_alphanumeric': 0.19067145053818554, 'fraction_numerical': 0.025115325474115838, 'mean_word_length': 4.674418604651163, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '213554', 'license': 'MIT', 'n_tokens_mistral': 886, 'n_tokens_neox': 880, 'n_words': 83, 'path': 'gif-pokmon.ipynb', 'repo_name': 'wcmckee/wcmckee', 'size': '1967'}