Skip to content

Instantly share code, notes, and snippets.

View njh's full-sized avatar

Nicholas Humfrey njh

View GitHub Profile
<?php
public function getFeedMapping()
{
$type = Zend_Uri::factory('http://purl.org/ontology/po/Programme');
$image_uri = Zend_Uri::factory($this->image->getUrl(512, 288));
if ($this->display_buzz) {
$hash_tags = $this->hash_tags;
$articles = $this->articles;
$discussions = $this->discussions;
} else {
#!/bin/sh
if [ -e Makefile ]; then
make maintainer-clean
fi
# This is in maintainer/debug mode
./autogen.sh
make
make distdir
@njh
njh / bbc_episodes_for_brand.rb
Created May 3, 2011 15:47
Ruby code to get all the episode PIDs for a BBC Brand
#!/usr/bin/env ruby
require 'rubygems'
require 'rdf'
require 'rdf/rdfxml'
PROGRAMMES_URL = 'http://www.bbc.co.uk/programmes'
PO = RDF::Vocabulary.new("http://purl.org/ontology/po/")
brand_pid = 'b0081dq5'
ip-60.aelius.co.uk (::) Tue May 17 18:22:47 2011
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. router-sis0.aelius.co.uk 0.0% 68 1.5 1.7 1.3 6.1 0.8
2. b.gormless.thn.aaisp.net.uk 0.0% 67 38.3 39.1 36.7 42.4 0.9
3. 2001:7f8:17::50e8:1 1.5% 67 39.6 39.6 38.0 45.9 1.3
4. 2001:7f8:17::8a61:2 54.5% 67 38.0 43.7 37.5 141.0 18.4
5. gi4-10.cr01.man.bytemark.co.uk 53.0% 67 172.3 59.7 43.7 194.6 37.8
6. lapwing.bytemark.co.uk 43.3% 67 45.4 46.5 43.7 50.5 1.7
Host Loss% Snt Last Avg Best Wrst StDev
1. router-sis0.aelius.co.uk 0.0% 171 1.6 1.6 1.3 6.4 0.6
2. b.gormless.thn.aaisp.net.uk 0.0% 171 38.7 39.5 36.2 66.9 2.8
3. 2001:7f8:4::50e8:1 0.6% 171 42.3 39.8 36.2 92.4 4.4
4. linx-gw1.ja.net 45.0% 170 38.5 43.5 36.5 108.8 12.7
5. ae1.lond-sbr4.ja.net 45.6% 170 41.4 44.9 36.3 147.3 18.2
6. 2001:630:0:10::101 45.0% 170 40.2 45.8 36.6 166.8 20.7
7. lense.lond-sbr1.ja.net 45.0% 170 42.4 43.5 40.4 80.0 3.9
8. 2001:630:c1:18::b 45.0% 170 43.0 43.5 40.4 53.9 2.1
9. 2001:630:c1:100::2 45.0% 170 53.4 47.0 40.3 245.4 21.1
{
"link" : {
"rel" : "self",
"href" : "http://dynamite.iplayer.bbc.co.uk/iplayer/ion/listview/block_type/episode/clips/exclusive/expose_tags/1/perpage/4/tag_scheme_namespace/musicbrainz/sort/dateavailable/sortdir/desc/format/json/tag_value/http%3A%2F%2Fmusicbrainz%2Eorg%2Fartist%2F183105b5%2D3e68%2D4748%2D9086%2D2c1c11bf7a3d",
"type" : "application/json",
"locale_str" : "en"
},
"count" : "2",
"pagination" : {
"page" : "1",
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns="http://musicbrainz.org/ns/mmd-1.0#" xmlns:ext="http://musicbrainz.org/ns/ext-1.0#">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata xmlns="http://musicbrainz.org/ns/mmd-1.0#">
<artist-list offset="0" count="52">
<artist type="Group" id="a3cb23fc-acd3-4ce0-8f36-1e5aa6a18432" ext:score="100" xmlns:ext="http://musicbrainz.org/ns/ext#-1.0">
<name>
U2
</name>
<sort-name>
@njh
njh / submit_isrcs.pl
Created May 21, 2011 15:10
Script to submit the ISRCs stored on an Audio CD to MusicBrainz
#!/usr/bin/perl
#
# Script to submit the ISRCs stored on an Audio CD to MusicBrainz
#
# By Nicholas Humfrey <njh@aelius.com>
#
#
# Version 0.5 - 29th May 2009
#
@njh
njh / wikipedia-abstract.pl
Created June 1, 2011 07:24
Perl script to fetch abstracts from the Wikipedia API
#!/usr/bin/env plackup
use LWP::UserAgent;
use XML::XPath;
use URI::Escape;
use Dancer;
use HTML::TreeBuilder;
use HTML::Entities;
use Time::Piece;
diff --git a/utils/roqet.c b/utils/roqet.c
index 910beea..5c95727 100644
--- a/utils/roqet.c
+++ b/utils/roqet.c
@@ -124,6 +124,7 @@ static struct option long_options[] =
static int error_count = 0;
+static int error_log_level = RAPTOR_LOG_LEVEL_WARN;