Skip to content

Instantly share code, notes, and snippets.

@hiroshikuze
Created December 14, 2019 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiroshikuze/1768580b530b3c704a03065c80805200 to your computer and use it in GitHub Desktop.
Save hiroshikuze/1768580b530b3c704a03065c80805200 to your computer and use it in GitHub Desktop.
RSSreaderlib.php ( https://kuje.kousakusyo.info/tools/RSSreaderlib/ )を使用したはてなブックマークRSSとの連携例(2009/05/16現在)
<?php
require_once "<< RSSreaderlib.phpへのパス >>";
$RSSReader = new RSSReader(
'<< 出力する文字コード(sjis/euc/utf-8など) >>',
'<< MagpieRSS内のrss_fetch.incへのパス >>',
'<< ロードするRSSのURL(例: http://b.hatena.ne.jp/halohalolin/rss )>>'
);
?>
<div style="
text-align:left;
font-size:0.8em;
background-color: #ffffff;
padding: 6px;
width:500px;
border: 2px solid #fff;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
">
<strong style="color:#ff0000;">最近の気になるブックマーク</strong>
<?php
echo "<ul>";
$max = ($RSSReader -> getContentsCount() > 5) ? 5: $RSSReader -> getContentsCount();
for($i = 0; $i < $max; $i++) {
echo "<li><a href=\"".$RSSReader -> getContentsURL($i)."\">".$RSSReader -> getContentsTitle($i)."</a><br />"
.$RSSReader -> getContentsDesc($i)."</li>";
}
echo "</ul>";
?>
<div style="text-align:right;"><a href=http://b.hatena.ne.jp/halohalolin/">&gt;&gt; その他の気になるブックマーク</a></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment