Skip to content

Instantly share code, notes, and snippets.

View metade's full-sized avatar

Patrick Sinclair metade

View GitHub Profile
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix mo: <http://purl.org/ontology/mo/> .
@prefix po: <http://purl.org/ontology/po/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix timeline: <http://purl.org/NET/c4dm/timeline.owl#> .
@prefix event: <http://purl.org/NET/c4dm/event.owl#> .
require 'rubygems'
require 'open-uri'
require 'hpricot'
require 'addressable/uri'
require 'feed-normalizer'
require 'rdelicious'
class DeliciousMusicNews
def initialize(username, password)
@links_to_gids = links_to_gids
require 'rubygems'
require 'feedalizer'
def six_music_hub
url = "http://www.bbc.co.uk/6music/events/hub/index.shtml"
f = feedalize(url) do
feed.title = "BBC 6 Music Hub Sessions"
feed.description = "Live sessions on BBC 6 Music"
scrape_items("a.watch") do |rss_item, html_element|
require 'rubygems'
require 'logger'
require 'IRC'
Thread.abort_on_exception = true
log = Logger.new('wikipedia_stats/en_wikipedia.log', 'daily')
bot = IRC.new('wiki-stats', 'irc.wikimedia.org', '6667')
IRCEvent.add_callback('endofmotd') { |event| bot.join('#en.wikipedia') }
IRCEvent.add_callback('privmsg') do |event|
require 'rubygems'
require 'open-uri'
require 'hpricot'
require 'json'
require 'rena'
require 'rdelicious'
def get_pids_in_schedule(url)
schedule = JSON.parse(open(url).read)
%h1 rdfa testing in haml
%div{ 'xmlns:dc' => "http://purl.org/dc/elements/1.1/" }
%h2{ :property => "dc:title" } The trouble with Bob
%h3{ :property => "dc:creator" } Alice
%div{ :about => "/alice/posts/jos_barbecue" }
%h2{ :property => "dc:title" } The trouble with Bob
%h3{ :property => "dc:creator" } Alice

Ramesh Jain - Keynote

  • Semantic Gap for users (bits, chars, lists -> events/objects, concepts)
  • Data and users: triangle
  • Semantic gap exists in text too - search engines do little beyond string matching
  • Semantic web tools help, much still to do
  • Life - events, experiences and multimedia: eventweb
  • Lots of multimedia - raises problems
  • Multimedia semantics: many approaches
  • Content-based: different model layers (data -> concepts)
<h1>Editing dot's needs </h1>
<form action="/users/dot/needs" class="edit_user" id="edit_user_1" method="post"><div style="margin:0;padding:0"><input name="_method" type="hidden" value="put" /><input name="authenticity_token" type="hidden" value="f2f0a71eecc65ae0827b545eae18d84ddb7ef72e" /></div>
<ul>
<li><input id="user_need_ids_83" name="user[need_ids][]" type="checkbox" value="83" />Doing everyday things
<ul>
<li><input id="user_need_ids_84" name="user[need_ids][]" type="checkbox" value="84" />Getting up and going to bed</li>
[{"imageURL": "http://we-need.org/sicamp/charts/786f939d2c82a86437f42df6607e9832.png", "count": 29, "needs": ["Doing everyday things", "Getting washed and dressed", "Moving about the house", "preparing meals", "eating", "Being with other people - family, friends, relationships ", "seeing and staying in touch with my family & friends ", "having someone to talk to ", "making friends ", "finding a life partner ", "Getting out and about ", "getting to work/shops/appointments/meetings ", "using public transport ", "sharing transport ", "Running my life ", "managing paper work ", "getting organised ", "Doing something useful ", "paid work ", "voluntary work ", "setting up a business ", "Education and learning ", "vocational courses ", "cultural studies ", "Holidays and Short Breaks ", "going on holiday ", "having a break for me and or my family ", "study break ", "retreat"], "label": "51.4985,-0.163669", "details": "<table>\n\n<td>Doing everyday things</td>\n<td>2</td>\n\n<td>Getting washed and dressed</td>\n<td>1<
require 'rubygems'
require 'hpricot'
require 'yaml'
task :convert_data do
doc = Hpricot(File.open('b00h752w.html'))
artists = (doc/'//a').map { |a| { :link =>a['href'], :name => a.inner_html, :offset => nil } }
File.open('data.yml', 'w') { |file| file.puts artists.to_yaml }
end