Skip to content

Instantly share code, notes, and snippets.

View papajuans's full-sized avatar
🙃

Ryan J papajuans

🙃
  • NY
View GitHub Profile
" Show syntax coloring
syntax enable
set tabstop=4
set autoindent
set hls
colorscheme desert
" Show line numbers
" set number
#!/bin/bash
#Declare array
declare -a ARRAY
#Open file for reading to array
exec 10<urls.txt
let count=0
while read LINE <&10; do
url=$LINE
hiturl="http://localhost:8000${LINE}"
import simplejson
import urllib
import PyRSS2Gen
hn_url = "http://news.ycombinator.com/"
#Run the YQL and get the JSON back
yql_url = "http://query.yahooapis.com/v1/public/yql?q=%20select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fnews.ycombinator.com%2Fnewest%22%20and%20xpath%3D'%2F%2Ftd%5B%40class%3D%22title%22%5D%2Fa'&format=json&callback="
yql_results = urllib.urlopen(yql_url) #The query will return JSON
yql_json = simplejson.load(yql_results)