Skip to content

Instantly share code, notes, and snippets.

View luptilu's full-sized avatar

Luisa Bider luptilu

  • London, United Kingdom
View GitHub Profile
@luptilu
luptilu / python_code_luisa_bider
Created January 5, 2018 07:53
python code used to scrape #WAD2017
import twitter, json, sys, csv #importing different modules needed for the execution of this code
# == OAuth Authentication ==
consumer_key="0r0UDwlVYwjQT4LEjXjBukCaL" #my consumer key
consumer_secret="M563XywN9Ug8XtX9Cn6xiYuyQGMzo3UPOhHsJ6OpIbSGWZjqtz" #my consumer secret
# Create an access token under the the "Your access token" section
access_token="918797696-6UylNJquJsdEAuPWpdKhopfXuFXc8oarv65XpJ4m"#my access token key
access_token_secret="KR2wsBRzQV7EAZyB37O1oTorePtddT8nir0g1Dc9urLQ5" #my access token secret
@luptilu
luptilu / royalbaby.py
Created April 24, 2018 14:38
#royalbaby python scraper
import twitter, json, sys, csv #importing different modules needed for the execution of this code
# == OAuth Authentication ==
consumer_key="THIS IS PRIVATE GET YOUR OWN" #my consumer key
consumer_secret="THIS IS PRIVATE GET YOUR OWN" #my consumer secret
# Create an access token under the the "Your access token" section
access_token="THIS IS PRIVATE GET YOUR OWN"#my access token key
access_token_secret="THIS IS PRIVATE GET YOUR OWN" #my access token secret
@luptilu
luptilu / syriaconf2018.py
Created April 24, 2018 15:13
a python twitter scraper for the syria conference 2018
import twitter, json, sys, csv #importing different modules needed for the execution of this code
# == OAuth Authentication ==
consumer_key="ADD YOUR OWN" #my consumer key
consumer_secret="ADD YOUR OWN" #my consumer secret
# Create an access token under the the "Your access token" section
access_token="ADD YOUR OWN"#my access token key
access_token_secret="ADD YOUR OWN" #my access token secret
@luptilu
luptilu / table-layout.html
Last active April 26, 2021 13:45
Embedding a table layout in your panels
<figure>
<h1 class="country">{{location}}</h1>
<div class="chart">
<iframe src="https://flo.uri.sh/visualisation/5266491/embed"></iframe>
</div>
<div class="sections">
<div class="section">
<h2>Health</h2>
@luptilu
luptilu / fake-legend.html
Created May 6, 2021 16:40
This code lets you create a legend to paste into the Layout > Text settings in Flourish.
<div style="font-size:0.9em; margin-top: 6px;">
<div style="float: left; margin-right:10px;"><b>Category</b></div>
<div style="background-color:#2db757; float:left; width:10px; height:17px; margin-right:3px; border-radius: 3px">
</div>
<div style="margin-right:10px; float:left">Environment</div>
<div style="background-color:#750e5c; float:left; width:10px; height:17px; margin-right:3px; border-radius: 3px">
</div>
<div style="margin-right:10px; float:left">Societal</div>
<div style="background-color:#ff6d00; float:left; width:10px; height:17px; margin-right:3px; border-radius: 3px">
</div>
<div style="font-size:0.9em; margin-top: 6px;">
<div style="float: left; margin-right:10px;"><b>Category</b></div>
<div style="background-color:#2db757; float:left; width:10px; height:17px; margin-right:3px; border-radius: 3px">
</div>
<div style="margin-right:10px; float:left">Environment</div>
<div style="background-color:#750e5c; float:left; width:10px; height:17px; margin-right:3px; border-radius: 3px">
</div>
<div style="margin-right:10px; float:left">Societal</div>
<div style="background-color:#ff6d00; float:left; width:10px; height:17px; margin-right:3px; border-radius: 3px">
</div>
<figure>
<div class="chart">
<ul style='width: 100%'>
<li>
<div class='party-name'>Legal Framework</div> <span class='party-bar'
style='width: calc({{Legal Framework}}*8%);'></span> <span class='party-value'>{{Legal
Framework}}</span>
</li>
<li>
<div class='party-name'>Skills Penetration</div> <span class='party-bar'
<div id='data-popup'>
<ul style='width: 140px;'>
<strong><span style='color:{{Colourwinning}}'>{{winningparty}}</span></strong><br><br>
<b>2016 vote share</b><br>
<li> <span class='party-name'>Dem</span> <span class='party-bar'
style='width: {{voteDem2016_pct}}; background-color: #0f69ff;'></span> <span class='party-value'
style='color: #0f69ff;'>{{voteDem2016_pct}}</span> </li>
<li> <span class='party-name'>Rep</span> <span class='party-bar'
style='width: {{voteRep2016_pct}}; background-color: #eb0f29;'> </span> <span class='party-value'
style='color:#eb0f29;'>{{voteRep2016_pct}}</span> </li>
<div id='data-panel'>
<ul style='width: 100%;'>
<strong><span style='color:{{Colourwinning}}'>
{{winningparty}}</span></strong><br><br>
<b>2016 vote share</b><br>
<li> <span class='party-name'>Dem</span> <span class='party-bar'
style='width: {{voteDem2016_pct}}; background-color: #0f69ff;'></span> <span class='party-value'
style='color: #0f69ff;'>{{voteDem2016_pct}}</span> </li>
<li> <span class='party-name'>Rep</span> <span class='party-bar'
style='width: {{voteRep2016_pct}}; background-color: #eb0f29;'>&nbsp;</span> <span class='party-value'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.