Advertisement
Guest User

pidgin-plugins.php

a guest
Jan 27th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.08 KB | None | 0 0
  1.     <?php
  2.  
  3.     require_once("lib/RSS2Writer.php");
  4.  
  5.     $rss = new RSS2Writer(
  6.         /* title: */ "Pidgin Plugin List",
  7.         /* description: */ "Pidgin Plugin List",
  8.         /* URL: */ "https://pidgin.im/plugins/"
  9.     );
  10.  
  11.     $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";
  12.  
  13.     $history = json_decode(file_get_contents($query));
  14.     foreach($history->values as $commit) {
  15.         $author = $commit->commit->author->user->display_name;
  16.         $message = $commit->commit->rendered->message->raw;
  17.         $content = $commit->commit->rendered->message->html;
  18.         $date = $commit->commit->date;
  19.         $hash = $commit->commit->hash;
  20.         $link = $commit->commit->links->html->href;
  21.  
  22.         $title = $author.": ".strtok($message, "\n");
  23.         $rss->addItem($title, $content, $link);
  24.         $rss->addCategory("Pidgin");
  25.         $rss->addElement('pubDate', $date);
  26.     }
  27.  
  28.     echo $rss->getXML();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement