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
# Client to control electrical appliances based on Twitter activity. | |
# Uses Tellstick USB (using Remotestick REST API http://wiki.github.com/pakerfeldt/remotestick/ ) and | |
# the Twitter API. | |
import twitter | |
import time | |
import httplib | |
api = twitter.Api() |
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
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/tomaswennstrom" -O twitter/twitterqr/1.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/kristinheinonen" -O twitter/twitterqr/2.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/findub" -O twitter/twitterqr/3.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/Alexlundborg" -O twitter/twitterqr/4.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/bjornjeffery" -O twitter/twitterqr/5.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/miriamolsson" -O twitter/twitterqr/6.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/macsolve" -O twitter/twitterqr/7.png | |
wget "http://chart.apis.google.com/chart?chs=450x450&cht=qr&chl=http://m.twitter.com/chronix" -O twitter/twitterqr/8.png | |
wget "http://chart.apis.go |
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
[{"name":"Speak","phrase":"It works. Enter 4 digits!"}, | |
{"name":"GetDigits","url":"http://moonhouse.se/url-to-hit-with-result.json","max":4}, | |
{"name":"Playback","filename":"airport"}, | |
{"name":"Playback","filename":"north-dakota"} | |
] |
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
resin01 | |
[110124 15:06:44] Completed 200 OK in 11403ms (Views: 1.0ms) | |
[110124 15:11:21] Completed 200 OK in 17588ms (Views: 1.0ms) | |
[110124 15:11:29] Completed 200 OK in 20115ms (Views: 2.0ms) | |
[110124 15:21:12] Completed 200 OK in 11249ms (Views: 47.0ms) | |
[110124 15:42:06] Completed 200 OK in 56854ms (Views: 1.0ms) | |
[110124 15:42:06] Completed 200 OK in 48723ms (Views: 1.0ms) | |
[110124 15:42:06] Completed 200 OK in 57663ms (Views: 1.0ms) | |
[110124 15:49:28] Completed 200 OK in 24672ms (Views: 1.0ms) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<universe> | |
<numbers> | |
<number>ett</number> | |
<number>två</number> | |
<number>tre</number> | |
<number>fyra</number> | |
<number>fem</number> | |
<number>sex</number> | |
<number>sju</number> |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
File.open(ARGV[0]) do |sFile| | |
while sLine = sFile.gets | |
doc = Nokogiri::HTML(open(sLine)) | |
puts doc.xpath('//meta[@property="og:image"]').first.attribute('content') | |
end | |
end |
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
require 'nokogiri' | |
require 'httparty' | |
def is_build_no(dir_name) | |
(dir_name =~ /\/\d*$/) != nil | |
end | |
def is_build_time(dir_name) | |
# Match paths ending with timestamps such as 2011-10-17_15-06-32 | |
(dir_name =~ /\/\d*-\d*-\d*_\d*-\d*-\d*$/) != nil |
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
# encoding: UTF-8 | |
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('blogdump.html')) | |
doc.xpath('//select[@name="primary_blog"]/option').each do |link| | |
blog_url = link.content | |
begin | |
rss = Nokogiri::XML(open("#{blog_url}/feed/")) |
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
def convert_rt90_to_wgs84(geopos) | |
# from http://mellifica.se/geodesi/gausskruger.js | |
geopos=geopos.first | |
x = geopos['x'].to_i | |
y = geopos['y'].to_i | |
axis = 6378137.0 # GRS 80. | |
flattening = 1.0 / 298.257222101 # GRS 80. | |
central_meridian = 15.0 + 48.0/60.0 + 22.624306/3600.0 |
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
# encoding: UTF-8 | |
require 'mechanize' | |
require 'builder' | |
@agent = Mechanize.new | |
def get_list(diary_id) | |
page = @agent.get("http://diarium.lansstyrelsen.se/default.aspx") | |
form = page.form('aspnetForm') |
OlderNewer