This file contains hidden or 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
| index | upload_date | duration | webpage_url | view_count | like_count | dislike_count | average_rating | series | season_number | episode_number | release_date | thumbnail | fulltitle | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Cy-O4myeUzg | 20161107 | 1949 | https://www.youtube.com/watch?v=Cy-O4myeUzg | 2801183 | 4.8850956 | https://i.ytimg.com/vi_webp/Cy-O4myeUzg/maxresdefault.webp | Mercadeo Multinivel: Last Week Tonight With John Oliver (HBO) | |||||||
| ekoETowzmAo | 20170118 | 84 | https://www.youtube.com/watch?v=ekoETowzmAo | 5724473 | 4.8252573 | https://i.ytimg.com/vi/ekoETowzmAo/maxresdefault.jpg | Season 4 Official Trailer: Last Week Tonight with John Oliver (HBO) | |||||||
| eAFnby2184o | 20141229 | 225 | https://www.youtube.com/watch?v=eAFnby2184o | 5421913 | 4.8301988 | https://i.ytimg.com/vi_webp/eAFnby2184o/maxresdefault.webp | New Year's Eve (Web Exclusive): Last Week Tonight with John Oliver (HBO) | |||||||
| FVFdsl29s_Q | 20170521 | 1446 | https://www.youtube.com/watch?v=FVFdsl29s_Q | 14654842 | 4.8198462 | https://i.ytimg.com/vi_webp/FVFdsl29s_Q/maxresdefault.webp | Stupid Watergate: Last Week Tonight with John Oliver (HBO) |
This file contains hidden or 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
| import requests | |
| from bs4 import BeautifulSoup | |
| import json | |
| from collections import defaultdict | |
| from random import randint | |
| from time import sleep | |
| ''' | |
| scraper for counts of each make of car found at autoscout.ch | |
| https://twitter.com/philshem/status/1295371670321070080 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| # made by @philshem | |
| # https://twitter.com/philshem/status/1256535940442591232 | |
| # the unlicense https://unlicense.org/ | |
| # requires youtube-dl and ffmpeg (easily installed with homebrew or conda) | |
| # download the video | |
| youtube-dl jS0bjDbWydw --output raw.mp4 | |
| # get dimensions | |
| # 1920 × 1080 in this case |
This file contains hidden or 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
| import os | |
| import pandas as pd | |
| from datetime import datetime | |
| url='https://www.swissgrid.ch/dam/dataimport/energy-statistic/EnergieUebersichtCH-{YEAR}.xls' | |
| dfs = [] | |
| for y in range(2009,datetime.now().year+1): | |
| # generate url with year in it | |
| url_y = url.format(YEAR=str(y)) |
This file contains hidden or 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
| # fetches raw data from https://shopsensor-272815.appspot.com/ | |
| # | |
| # requires multiple queries for each city's bounding box | |
| # | |
| # if you actually run this, pipe each curl statement to a seperate file | |
| # bern, 27 results | |
| curl 'https://shopsensor-272815.appspot.com/searchresults' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: application/json; charset=utf-8' -H 'X-Requested-With: XMLHttpRequest' -H 'Origin: https://shopsensor-272815.appspot.com' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Referer: https://shopsensor-272815.appspot.com/' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' --data '{"_southWest":{"lat":46.92687938388263,"lng":7.421092987060548},"_northEast":{"lat":46.96941802389087,"lng":7.471647262573243}}' | |
| # > bern.json |
This file contains hidden or 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
| #!/usr/bin/env python | |
| ''' | |
| Post processing the scrape job | |
| requires `pip install pandas gcsfs` | |
| ''' | |
| import pandas as pd | |
| import numpy as np | |
| from datetime import datetime |
This file contains hidden or 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
| import pandas as pd | |
| import numpy as np | |
| from datetime import datetime | |
| url = 'https://raw.githubusercontent.com/openZH/covid_19/master/COVID19_Fallzahlen_Kanton_ZH_alter_geschlecht.csv' | |
| # define date parsing format | |
| dateparse = lambda dates: [datetime.strptime(d, '%d.%m.%Y') for d in dates] | |
| # read csv from web |