Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("lib/RSS2Writer.php");
- $rss = new RSS2Writer(
- /* title: */ "Pidgin Plugin List",
- /* description: */ "Pidgin Plugin List",
- /* URL: */ "https://pidgin.im/plugins/"
- );
- $query = "https://bitbucket.org/!api/2.0/repositories/pidgin/nest/filehistory/default/hugo/data/plugins.json?pagelen=30&renames=false&fields=%2Bvalues.commit.message%2C%2Bvalues.commit.rendered.message%2C%2Bvalues.commit.author.%2A%2C%2Bvalues.commit.date";
- $history = json_decode(file_get_contents($query));
- foreach($history->values as $commit) {
- $author = $commit->commit->author->user->display_name;
- $message = $commit->commit->rendered->message->raw;
- $content = $commit->commit->rendered->message->html;
- $date = $commit->commit->date;
- $hash = $commit->commit->hash;
- $link = $commit->commit->links->html->href;
- $title = $author.": ".strtok($message, "\n");
- $rss->addItem($title, $content, $link);
- $rss->addCategory("Pidgin");
- $rss->addElement('pubDate', $date);
- }
- echo $rss->getXML();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement