Created
December 14, 2019 13:05
-
-
Save hiroshikuze/1768580b530b3c704a03065c80805200 to your computer and use it in GitHub Desktop.
RSSreaderlib.php ( https://kuje.kousakusyo.info/tools/RSSreaderlib/ )を使用したはてなブックマークRSSとの連携例(2009/05/16現在)
This file contains 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 | |
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/">>> その他の気になるブックマーク</a></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment