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 code searches for tweets with a particuar keyword and writes certain fields into a CSV file | |
import sys, csv | |
import twitter | |
import os | |
import tweepy | |
# Replace the API_KEY and API_SECRET with your application's key and secret. | |
#This code is using AppAuthHandler, not OAuthHandler to get higher limits, 2.5 times. | |
auth = tweepy.AppAuthHandler('YOUR_API_KEY', 'YOUR_SECRET_API_KEY') |
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
$(window).scroll(function () { | |
if($(this).scrollTop() != 0) { | |
$('#').fadeIn("slow"); //If NOT at top/0px, # fades in | |
} else { | |
$('#').fadeOut("fast"); | |
} | |
}); |
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
window.onscroll = function() {myFunction()}; | |
function myFunction() { | |
var winScroll = document.documentElement.scrollTop; | |
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; | |
var scrolled = (winScroll / height) * 100; | |
document.getElementById("#").style.width = scrolled + "%"; | |
} |
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
$(document).ready(function() { | |
function loop() { | |
$('#').animate({"top": 0}); | |
$('#').animate({ | |
"top": 20, | |
}, 1500, function() { | |
loop(); | |
}); | |
} | |
loop(); |
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
var sitecode = "LW4" | |
var URL = "http://api.erg.kcl.ac.uk/AirQuality/Daily/MonitoringIndex/Latest/SiteCode=" + sitecode + "/Json"; | |
console.log('Fetching air quality data from-' + URL); | |
function processResult(data) { | |
var LAsite_data = data.DailyAirQualityIndex.LocalAuthority; | |
console.log(data); |