Created
April 27, 2012 01:40
-
-
Save scintill/2504930 to your computer and use it in GitHub Desktop.
Convert Google Reader exported JSON of starred items to a Bookmark HTML file for importing in browser
This file contains hidden or 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
<?php | |
ini_set('date.default_timezone', 'America/Denver'); | |
?> | |
<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<!-- This is an automatically generated file. | |
It will be read and overwritten. | |
DO NOT EDIT! --> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks</H1> | |
<DL><p> | |
<DT><H3 ADD_DATE="0" LAST_MODIFIED="<?=time()?>">Google Reader Starred Items</H3> | |
<DL><p> | |
<?php | |
$items = json_decode(file_get_contents('starred-items.json'))->items; | |
foreach ($items as $item) { | |
?><DT><A HREF="<?=htmlentities($item->alternate[0]->href, null, 'UTF-8')?>" ADD_DATE="<?=substr($item->timestampUsec, 0, -6)?>"><?=htmlentities($item->title, null, 'UTF-8')?></A><?php | |
echo "\n"; | |
} | |
?></DL> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment