Skip to content

Instantly share code, notes, and snippets.

// the location we want to GeoCode
var location = 'London';
// we are using MapQuest's Nominatim service
var geocode = 'http://open.mapquestapi.com/search?format=json&q=' + location;
// use jQuery to call the API and get the JSON results
$.getJSON(geocode, function(data) {
// get lat + lon from first match
var latlng = [data[0].lat, data[0].lon]]
#Autors F.Zottele (Fondazion E.Mach (IT)) and E.DELAY (GEOLAB, université de Limoges (FR))
#Script for download 45 twittes with twitter API for dev
rm(list=ls())
setwd("~/git/datablogvinometro/twitteR/data/")
library(twitteR)
library(lubridate)
reqURL = "https://api.twitter.com/oauth/request_token"
accessURL = "http://api.twitter.com/oauth/access_token"
authURL = "http://api.twitter.com/oauth/authorize"
consumerKey = "nP9JdRBlToVZ4xXrNeUbw"
consumerSecret = "KsK7qsu13cEUXhlpUSSo4UGHsoSTuBvwVPqzKAb6DqU"
library(twitteR)
twitCred = OAuthFactory$new(consumerKey=consumerKey,consumerSecret=consumerSecret,requestURL=reqURL,accessURL=accessURL,authURL=authURL)
twitCred$handshake()
save(twitCred, file="../cred.RData")
#Autors : E.DELAY (GEOLAB, université de Limoges (FR))and F.Zottele (Fondazion E.Mach (IT))
#Script merge data from twitteR script and map it with hexagon cell for couned twittes
rm(list=ls())
setwd("~/git/datablogvinometro/twitteR/data/csv/")
# dataToMap<-read.csv("dataToMap.csv", head=T)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pierrelorioux
pierrelorioux / README.md
Last active August 29, 2015 14:06
An aRanger arrangment.

An arrangement of items made through aRanger.

@pierrelorioux
pierrelorioux / Beirut_AirBnb.py
Last active August 29, 2015 14:14
AirBnB scrapping - Washington (page 1 to 56)
# coding=utf-8
from bs4 import BeautifulSoup
import csv
import requests
with open('washington.csv', 'w') as csvfile:
fieldnames = ['flat','url','lat','lon','usr','price_night']
writer = csv.DictWriter(csvfile, delimiter=';',fieldnames=fieldnames)
------------------------------------------------------------------------------------------------------------------------------
DESCRIPTION:
Notes for deploying TileStream on an AWS EC2 Ubuntu 12.04.2 Server for development. Includes workflow for creating
a local tile cache with TileMill, connecting to your Ubuntu EC2 server via SSH using Mac OSX Terminal, and uploading
your tiles (.mbtiles) to your TileStream server.
REFERENCES:
TileStream git repo: https://github.com/mapbox/tilestream
-----------------------------------------------------------------------------------------------------------------------------
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
CREATE TABLE images as
SELECT ROWID, "tile_data", tile_row as "tile_id"
FROM "tiles"
ORDER BY ROWID