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
| from bs4 import BeautifulSoup | |
| import requests | |
| import re | |
| import urllib2 | |
| import os | |
| import argparse | |
| import sys | |
| import json | |
| # adapted from http://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search |
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
| result.entities.urls[0].expanded_urlfetch = function(query) { | |
| var script_tag = document.createElement("script"); | |
| script_tag.id = "fetcher"; | |
| script_tag.src = "https://search.twitter.com/search.json"+query+"&callback=parse"; | |
| document.body.appendChild(script_tag); | |
| } | |
| parse = function(data) { | |
| document.body.removeChild(document.getElementById("fetcher")); | |
| if( data && data.results ) { |