Stack2RSS 1.0
A simple web application that creates an RSS feed given an API route.

src/converters/top_user_converter.php

Go to the documentation of this file.
00001 <?php
00002 
00003 /// \file top_user_converter.php Contains the conversion class for top user objects.
00004 
00005 // This class derives from Converter
00006 require_once 'converter.php';
00007 
00008 /// Provides conversion for top user objects
00009 class TopUserConverter extends Converter
00010 {
00011     protected function GetTitle($json_item)
00012     {
00013         $mod =  ($json_item['user']['user_type'] == 'moderator')?'♦':'';
00014         
00015         return "{$json_item['user']['display_name']}{$mod} - {$json_item['user']['reputation']}";
00016     }
00017     
00018     protected function GetDescription($json_item)
00019     {
00020         return "<b>Reputation from tag:</b> {$json_item['score']}<br /><b>Post count:</b> {$json_item['post_count']}";
00021     }
00022     
00023     protected function GetLink($json_item)
00024     {
00025         return "http://{$_GET['site']}/users/{$json_item['user']['user_id']}";
00026     }
00027     
00028     protected function GetDate($json_item)
00029     {
00030         // Use the current date
00031         return date(DATE_RSS);
00032     }
00033 }
00034 
00035 ?>
 All Classes Files Functions Enumerations