Skip to content

Instantly share code, notes, and snippets.

@hiroshikuze
Last active December 14, 2019 13:07
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/bea3159232e359ad21e7f00adfb7023e to your computer and use it in GitHub Desktop.
Save hiroshikuze/bea3159232e359ad21e7f00adfb7023e to your computer and use it in GitHub Desktop.
MagpieRSSとRSSreaderlib ( https://kuje.kousakusyo.info/tools/RSSreaderlib/ )を用いてtwitter記事を取り込む(2010/04/11現在)
<?php
RSSReader(CALL_MAKE_TEMPFILE_FOLDER, $temp);
$TwitterReader -> RSSReader(
'sjis',
'(MagpieRSSのrss_fetch.inc設置先)',
'http://twitter.com/statuses/user_timeline/19641481.rss'
);
$max = ($TwitterReader -> getContentsCount() > 5) ? 5: $TwitterReader -> getContentsCount();
for($i = 0; $i < $max; $i++) {
$comment = str_replace("hiroshikuze: ","",$TwitterReader -> getContentsTitle($i));
if(strlen($comment) > 70) { $comment = substr($comment, 0, 50)."...".substr($comment, -10); }
echo " <li><a href="\"".$TwitterReader" -=""> getContentsURL($i)."\">".$comment."</a> [".date("y/m/d H:i.s", $TwitterReader -> getContentsTimestamp($i))."]</li>\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment