Skip to content

Instantly share code, notes, and snippets.

View basilesimon's full-sized avatar

Basile Simon basilesimon

View GitHub Profile
{
"nodes": [
{
"name": "intro",
"text": "Hey, it's Salif. I'm finally leaving. I can't live here anymore, Syria's too dangerous now."
},
{
"text": "One of my cousins is in Germany. He's a barber, like my dad used to be."
},
{
@basilesimon
basilesimon / list.csv
Last active August 29, 2015 14:16
General Election 2015 candidates' Twitter handles
WAKLibDems RuthSmeeth mitch_1uk Go4Lowe ReshamKotecha Jack_Tinley iaingartside votejamesberry CllrScottMann CllrAnnSteward CharlotteHT_ julianknight15 lindsey4wnorth KevinGillottPPC WillJMartindale SamJRushworth RuthCadbury Mari_Williams JoeCookeLabour paulasherriff natashamillward rupahuq Steph_Peacock CatherineWest1 RichardBurgon lloydrm ToddDForeman Jessica_Asato annaturley SachinPatel_87 wdjstraw HuwSECambLabour KateVotesLabour JuliaTickridge clairethomas1 liverlibdems DrJennyWoods gracelibdem liz4stratford JackieLibDem ann4oxfordeast DavidHMalone derbynukipppc Neilkelly13 stevenjbrookes green_mac robjlinds MachanUkip ettiespencer howell_karen charliekiss brisfox CllrMattBrown cllrsrichardson angelamawle ianddriver dinahkeal emmawarman mapesburygreen maureenchilds2 davidschofiel18 CllrRichardLee ukip_swindon idhamramadi kevin_kerrigan1 xanderedz77 paulhalliday PaulForWest
@basilesimon
basilesimon / script.py
Created January 22, 2015 17:25
Scraping CENTCOM's PRs with Python
import json
from bs4 import BeautifulSoup
from urllib2 import urlopen
from urlparse import urljoin
BASE_URL = "http://www.centcom.mil"
BASE_NEWS_URL = "http://www.centcom.mil/en/news"
NEWS_PAGE_URL = BASE_NEWS_URL + "/P"
@basilesimon
basilesimon / links_collections.json
Created January 14, 2015 17:40
Scraping CENTCOM's PRs with Python
@basilesimon
basilesimon / test.py
Created January 13, 2015 21:00
THE SOLUTION
from bs4 import BeautifulSoup
from urllib2 import urlopen
BASE_URL = "http://www.chicagoreader.com"
def make_soup(url):
html = urlopen(url).read()
return BeautifulSoup(html, "lxml")
def get_category_links(section_url):
@basilesimon
basilesimon / listofpolys.json
Last active August 29, 2015 14:06
Datastringer example: Greater London crime stats
[
"51.517146,0.122688:51.523335,0.15648:51.514469,0.164677:51.530696,0.186926:51.554952,0.182242:51.565324,0.157149:51.561978,0.151963:51.563818,0.146276:51.575528,0.148618:51.582889,0.147614:51.596606,0.141591:51.597777,0.135904:51.598948,0.128543:51.588576,0.130383:51.579376,0.117335:51.561142,0.122354:51.555621,0.096592:51.543075,0.091908:51.54709,0.067484:51.540566,0.078023:51.528688,0.089231:51.524841,0.097763",
"51.677572,-0.190803:51.672052,-0.197495:51.672052,-0.196658:51.675063,-0.203517:51.676568,-0.212885:51.67339,-0.210878:51.668037,-0.220246:51.663855,-0.23045:51.659673,-0.249019:51.657498,-0.260561:51.638093,-0.271936:51.641606,-0.278461:51.633576,-0.302383:51.632907,-0.2982:51.623372,-0.271435:51.599785,-0.251026:51.585063,-0.257717:51.580379,-0.254037:51.573521,-0.250022:51.567164,-0.246844:51.57235,-0.240654:51.574692,-0.215729:51.553112,-0.200339:51.553112,-0.172904:51.574357,-0.169224:51.579041,-0.169726:51.586736,-0.160859:51.587405,-0.159019:51.590249,-0.163034:51.591755,-0.164038:51.6022
@basilesimon
basilesimon / data.json
Created August 29, 2014 17:30
GPS boundaries of London boroughs
{
"Barking and Dagenham": "51.517146,0.122688:51.523335,0.15648:51.514469,0.164677:51.530696,0.186926:51.554952,0.182242:51.565324,0.157149:51.561978,0.151963:51.563818,0.146276:51.575528,0.148618:51.582889,0.147614:51.596606,0.141591:51.597777,0.135904:51.598948,0.128543:51.588576,0.130383:51.579376,0.117335:51.561142,0.122354:51.555621,0.096592:51.543075,0.091908:51.54709,0.067484:51.540566,0.078023:51.528688,0.089231:51.524841,0.097763",
"Barnet": "51.677572,-0.190803:51.672052,-0.197495:51.672052,-0.196658:51.675063,-0.203517:51.676568,-0.212885:51.67339,-0.210878:51.668037,-0.220246:51.663855,-0.23045:51.659673,-0.249019:51.657498,-0.260561:51.638093,-0.271936:51.641606,-0.278461:51.633576,-0.302383:51.632907,-0.2982:51.623372,-0.271435:51.599785,-0.251026:51.585063,-0.257717:51.580379,-0.254037:51.573521,-0.250022:51.567164,-0.246844:51.57235,-0.240654:51.574692,-0.215729:51.553112,-0.200339:51.553112,-0.172904:51.574357,-0.169224:51.579041,-0.169726:51.586736,-0.160859:51.587405,-0.159019:51.590249
@basilesimon
basilesimon / collection.json
Created July 25, 2014 14:59
Police.uk API Postman collection
{
"id": "2e952df7-f894-48e4-1fb3-bc26dd3cac31",
"name": "Police.uk",
"description": "",
"order": [
"3727f908-a368-07d7-c707-5cd6be945bf6",
"17ea1b33-79fe-b2d3-68f6-3112b3160304",
"d14f413a-0756-b3c6-0a11-b99189bf5e1c",
"c73977b9-e3a5-25e6-659f-a4d03f255df9",
"a1aecba7-a85b-4043-1d54-7abf838cce45",
@basilesimon
basilesimon / result.json
Created June 13, 2014 12:42
What I need
{
"occurrences" : [
{
"label" : "one",
"thing" : "url_string",
"occurrence": 100
},{
"label" : "linkedWithOne",
"thing" : "url_string",