Skip to content

Instantly share code, notes, and snippets.


Ryan McCue rmccue

View GitHub Profile
View proxy
From 253278458860aadf0d25b11351357bcf90c6db7a Mon Sep 17 00:00:00 2001
From: Ryan McCue <>
Date: Tue, 29 Sep 2009 19:41:53 +1000
Subject: [PATCH] Add proxy support. Closes #19
--- | 78 +++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 60 insertions(+), 18 deletions(-)
diff --git a/ b/
rmccue / gist:248095
Created Dec 3, 2009
A quick demo of how to get comments for a Blogger post with SimplePie.
View gist:248095
$sp = new SimplePie('', './cache');
foreach($sp->get_items() as $item) {
echo '<h2>' . $item->get_title() . '</h2>';
$link = $item->get_link(0, 'replies');
if($link) {
$comments = new SimplePie($link);
foreach($comments->get_posts() as $comment) {
echo 'Comment: ' . $comment->get_content();
rmccue / gist:250195
Created Dec 6, 2009
Read SimplePie cache without opening SimplePie
View gist:250195
$cache = SimplePie_Cache::create($cache_location, md5($url), 'spc');
// Load data
$data = $cache->load(); // returns instance of SimplePie
// Get timestamp
$time = $cache->mtime(); // returns integer
rmccue / gist:250682
Created Dec 7, 2009
Normalise SimplePie items to put into a database
View gist:250682
$feed = new SimplePie('');
foreach($feed->get_items() as $item) {
$new_item = (object) array(
'hash' => $item->get_id(true),
'timestamp' => $item->get_date('U'),
'title' => $item->get_title(),
'content' => $item->get_content(),
rmccue / blackout.php
Created Dec 21, 2009
A plugin for the Great Australian Internet Blackout
View blackout.php
Plugin Name: Blackout your Blog
Description: From Monday, January 25th to Friday, January 29th, Aussie websites will turn their lights out — "black out" — to inform Australians about the threat of imposed Internet censorship. Pledge your support, and install this plugin!
Version: 1.0
Author: Ryan McCue
function blackout_js() {
rmccue / webapp.ini
Created Dec 24, 2009
Code to make Hahlo work properly in a Prism app
View webapp.ini
rmccue / disable_gsfn.php
Created Mar 21, 2010
Disable Lilina's Get Satisfaction widget on public-facing site.
View disable_gsfn.php
Plugin Name: Disable Feedback Widget
Plugin Description: Disables the feedback widget on a public site
Plugin URI:
Author: Ryan McCue
Author URI:
Version: 1.0
Min Version: 1.0
View simplepie-gametrailers.php
// Extend SimplePie to retrieve the embed data from a feed
// Load SimplePie
// Define the GameTrailers namespace
// Extend SimplePie_Item with our own class
rmccue / aggregate-feed.php
Created Apr 22, 2010 — forked from smajda/aggregate-feed.php
An improved version of the RSS merger
View aggregate-feed.php
/* Merge multiple RSS feeds with SimplePie
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
* Help from:
rmccue / simplepie-title-sort.php
Created May 14, 2010
Sort items by title instead of date
View simplepie-title-sort.php
class SimplePie_Title_Sort extends SimplePie {
function sort_items($a, $b)
return strlen($a->get_title()) >= strlen($b->get_title());