h4x3d.com

- h4x3d.com

Archive
Tag "lifestream"

Many people have asked me how I embedded the available Lifestream plugins (or code) so that it looks like mine at h4x3d.com/lifestream

Many seem to struggle with the (yet) simple set-up or use the wrong (and buggy) files.
Since the Lifestream I use is a mixture of different Lifestream plugins and it is all open-source, I would like to lift some secrets and share my knowledge with you.

My resources include Jeremy Keith‘s Lifestream plugin code (at the bottom), Elliot Back‘s Lifestream code (that did not work correctly), this article, a blog dedicated to Lifestreams and last but not least Gunnar Þór Hafdal – the Lifestream godfather. I was lucky to pick-up his code. I removed some items here and there, but in general he did 99,9% of the work, thank you!. I wonder why he took down his Lifestream and the code samples? They were great.

Below you will find the code, please note that the WordPress Plugin integration does not work, you will have to hand-code the variables such as FlickrRSS etc in the life.php itself.

NOTE: You need to run a quick CTRL+H (find and replace) for the < ?php… the code-markup on this page is that way so it does not break anything. You need to finalize the script yourself by changing all instances of < ?php back to the original (delete the blank space)

Life.php (goes in Theme folder)


 'http://feeds.feedburner.com/Twitter/h4x3d',
		'life_blog' => 'http://feeds.feedburner.com/jez',
		'life_flickr' => 'http://api.flickr.com/services/feeds/photos_public.gne?id=29642584@N00&format=rss_200',
		'life_delicious' => 'http://feeds.feedburner.com/Delicious/h4x3d?format=xml',
		'life_lastfm' => 'http://ws.audioscrobbler.com/1.0/user/h4x3d/recenttracks.rss',
		'life_digg' => 'http://digg.com/rss/jizz/index2.xml',
		'life_cocomment' => 'http://www.cocomment.com/myrss2/jez.rss'
		);
}

function checkStreams() {
	if( get_option( 'life_installed' ) ) {
	} else {
		self::install();
	}
}

function install() {
	add_option( 'life_installed', '1', "" );
	add_option( 'life_version', '1.0', "");
	foreach ( self::defaultStreams() as $key => $value ) {
		add_option( $key, $value, "" );
	}
	/* echo 'Installed, ready to go.' */;
}

function upgrade() {
	foreach ( self::defaultStreams() as $key => $value ) {
		if( !get_option( $key ) ) {
		add_option( $key, $value, "" );
		echo 'Added ' . $key;
		}
	}
}

function loadStreams() {
	foreach( self::defaultStreams() as $key => $value ) {
	// find the values for each of our streams (RSS Feeds)
		if( get_option( $value ) ) {
			$value = get_option(  $value );
		} else {
			echo '

' . $key . ': ' . $value . ' not found in the database.

';
		}
	}
}
}

life::checkStreams();

?>

Another file

Stream.php (goes in Theme folder)



(legend of tags)

<a href="" rel="bookmark" title="Permanent Link to ">

< ?php the_content('

Continue reading this article'); ?> $feed ) { $rss = @fetch_rss( $feed ); $items = $rss->items = array_slice( $rss->items, 0 ); foreach ($items as $item ) { $date = strtotime( substr( $item['pubdate'], 0, 25 ) ); // This fixes the time error that the "date_default_timezone_set" should fix // Set it as $date += 3600*1; to add 1 hour or $date -= 3600*1; to remove 1 hour // I think it's based around the UTC time $date += 3600*2; $list[ $date ][ "name" ] = $name; foreach ($details as $detail) { $list[$date]['title'] = $item['title']; $list[$date]['link'] = $item['link']; } } } krsort( $list ); $day = ''; foreach ( $list as $timestamp => $item ) { $this_day = date("F jS",$timestamp ); if ( $day != $this_day ) { ?> <tr class="vevent ">

<img src="" alt="" /> <abbr title=""> (special code goes here, see below)*
Sorry, no posts matched your criteria.

*Special code, it breaks the display, type it down yourself in order to make it work. Don’t be lazy :)

1 <a class=”url summary” href=”< ?php echo $item["link"]; ?>”>< ?php echo $item["title"]; ?></a>

Again Credits go to Gunnar, he’s the man

Read More

This post was written in reply to keasone.de kind of survey of website (and web2.0 elements) usage | Initially, the questions were asked in German, but due to the international audience over here, I am going to translate them to English.

English: Do you use Social Bookmarking/Networking pages such as Digg, Yigg, Mister Wong or Del.Icio.Us? If so, which?

German: Nutzt Du Social Bookmarking/Networking Seiten wie Digg, Yigg, Mister Wong oder Del.Icio.Us? Wenn ja, welche?

On my website h4x3d.com I am using digg, technorati, del.icio.us (hate to spell that!), sphere.com, blogmarks.net, ma.gnolia.com and furl to offer my users all the social bookmarking tools that are currently popular. Mr. Wong is not yet available in English, so a strict no-go for me. Personally I only use digg and del.icio.us.

English: Do you watch videos on video portals such as YouTube, Sevenload or DailyMotion? If so, what kind of Videos?

German: Schaust Dir Videos bei Videoportalen wie YouTube, Sevenload oder DailyMotion an? Wenn ja, was für Videos guckst Du Dir meistens an?

I do not waste time on YouTube, because for some reason it is extremely slow whenever I am trying to find something. DailyMotion is great, but Videos you watched one day are gone the other. I used to collect Simpsons videos on the internet, but with one swift move, DailyMotion deleted them all. From time to time I watch the remaining FamilyGuy episodes on bolt.com. Actually that’s only because I am lazy, since I do own the original FG DVDs.

English: Do you know/use Flickr?
German: Kennst bzw. nutzt Du Flickr?

Who does not know flickr? I am using flickr to share all my pictures from university, trance events or whatever I capture using my crappy cellphone camera. When I need to post newly accquired vinyl covers, I use the flickr API which comes built in with some cool plugin in WordPress. Really makes posting fun.

English: What do you think of services such as Twitter or Frazr?
German: Was hältst Du von Diensten wie Twitter oder Frazr?

I have been using Twitter only for testing their API (it’s actually only a RSS Feed…) and I am not using it daily. I think twitter is great waste of time and can be addictive for some people. Facebook offers similar twitter abilities. I don’t know Frazr. Cool name though! Oh btw. Alex, I deleted you from my friends list (it’s empty now), not as I don’t like you :p but as you were filling up my LifeStream (stupid RSS-Feed)!


English: How many RSS-Feeds are you subscribed to?
German: Wie viele RSS-Feeds hast Du abonniert?

Between 4 and 5, it really depends on the quality of content. I am subscribed to LifeHacker’s RSS-Feed and love it. However, sometimes it can become quite spammy, as they post 9–10 times a day. RSS-Feeds are a good way of catching up with other websites’ development, but again: also a great waste of time. I have subscribed to my own RSS-Feed in order to check if there are errors from time to time. I am using Feedburner to direct my posts to Feeds.

English: Do you read them daily?
German: Liest Du die alle täglich?

No, not really. Only if I need to waste time..

English: How many blogs do you maintain/author?
German: In wie vielen Weblogs bloggst Du?
(Eigene oder Mitautor)

Only h4x3d.com and some minor small blogs that are not yet ready for public release.

English: Do you comment on other blogs? If so, what?
German: Kommentierst Du in anderen Blogs? Wenn ja was?

Yes, sure. Whenever I find something useful and commentworthy I leave my 5cent.

(there are more questions, but as I have to go now and have loads of other things to do today I am not going to comment on those. Thanks to keasone for throwing this stick to me, and hereby I am throwing back.. enjoy)

Read More