Stack2RSS 1.0
A simple web application that creates an RSS feed given an API route.
|
00001 <?php 00002 00003 /// \file top_tag_converter.php Contains the conversion class for top tags objects. 00004 00005 // This class derives from Converter 00006 require_once 'converter.php'; 00007 00008 /// Provides conversion for top tags objects 00009 class TopTagConverter extends Converter 00010 { 00011 protected function GetTitle($json_item) 00012 { 00013 return "{$json_item['tag_name']}"; 00014 } 00015 00016 protected function GetDescription($json_item) 00017 { 00018 return <<<EOD 00019 <b>Reputation earned from questions:</b> {$json_item['question_score']}<br /> 00020 <b>Reputation earned from answers:</b> {$json_item['answer_score']}<br /> 00021 <b>Questions asked with this tag:</b> {$json_item['question_count']}<br /> 00022 <b>Answers to questions with this tag:</b> {$json_item['answer_count']} 00023 EOD; 00024 } 00025 00026 protected function GetLink($json_item) 00027 { 00028 // Just send the user to the site since we don't have a meaningful 00029 // URL for this item. 00030 return "http://{$_GET['site']}/"; 00031 } 00032 00033 protected function GetDate($json_item) 00034 { 00035 // Use the current date 00036 return date(DATE_RSS); 00037 } 00038 } 00039 00040 ?>