__construct() 공개 메소드

public __construct ( $config )
예제 #1
0
 public function __construct($config)
 {
     $config['link'] = 'http://pinboard.in/u:' . $config['username'] . '/';
     $config['url'] = sprintf('http://feeds.pinboard.in/rss/secret:%s/u:%s/', $config['secret'], $config['username']);
     parent::__construct($config);
     $this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a></li>' . "\n");
 }
예제 #2
0
 public function __construct($config)
 {
     $config['link'] = 'http://delicious.com/' . $config['username'] . '/';
     $config['url'] = sprintf('http://feeds.delicious.com/v2/rss/%s?count=%s', $config['username'], $config['total']);
     parent::__construct($config);
     $this->setItemTemplate('<li class="link"><a href="{{{link}}}">{{{title}}}</a>{{{tags}}}</li>' . "\n");
 }
예제 #3
0
파일: Delicious.php 프로젝트: j15e/pubwich
 public function __construct($config)
 {
     $config['link'] = 'http://del.icio.us/' . $config['username'] . '/';
     $config['url'] = sprintf('http://feeds.delicious.com/v2/rss/%s?count=%s', $config['username'], $config['total']);
     parent::__construct($config);
     $this->setItemTemplate('<li><a href="{%link%}">{%title%}</a></li>' . "\n");
 }
예제 #4
0
 public function __construct($config)
 {
     $config['link'] = 'http://www.facebook.com/' . $config['username'] . '/';
     $config['url'] = sprintf('http://www.facebook.com/feeds/status.php?id=%d&viewer=%d&key=%s&format=rss20', $config['id'], $config['id'], $config['key']);
     parent::__construct($config);
     $this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a> {{{date}}}</li>' . "\n");
 }
예제 #5
0
 public function __construct($config)
 {
     $config['link'] = 'http://www.instapaper.com/';
     $config['url'] = sprintf('http://www.instapaper.com/archive/rss/%s/%s', $config['userid'], $config['token']);
     parent::__construct($config);
     $this->setItemTemplate('<li><a href="{{{link}}}">{{{title}}}</a></li>' . "\n");
 }
예제 #6
0
 public function __construct()
 {
     parent::__construct("https://i-share.carli.illinois.edu/newbooks/newbooks.cgi?library=WHEdb&list=all&day=7&op=and&text=&lang=English&submit=RSS");
     $nitems = count($this->xml->channel->item);
     for ($i = 0; $i < $nitems; ++$i) {
         $tidy_desc = \str_replace(array('&lt;B&gt;', '&lt;/B&gt;', '<description>', '</description>'), '', $this->xml->channel->item[$i]->description->asXML());
         $matches = array();
         if (\preg_match('@&lt;img border="0" src="(.*)" vspace="3" border="0" align="right"/&gt;@', $tidy_desc, $matches)) {
             if (\util\Utility::isValidImage($matches[1])) {
                 $imgurl = $matches[1];
             } else {
                 $imgurl = "";
             }
             $tidy_desc = str_replace($matches[0], '', $tidy_desc);
         } else {
             $imgurl = "";
         }
         $fieldstr = \explode('&lt;BR/&gt;', $tidy_desc);
         $this->xml->channel->item[$i]->description = \implode("\n", $fieldstr);
         $fields = array();
         foreach ($fieldstr as $f) {
             //separate field name and field value
             $matches = array();
             if (\preg_match("/^([-a-zA-Z_ ]*[a-zA-Z]{4}): /", $f, $matches)) {
                 $fname = \strtolower(str_replace(' ', '_', \trim($matches[1])));
                 $fvalue = \trim(str_replace($matches[0], '', $f));
                 $fields[$fname] = $fvalue;
                 $this->xml->channel->item[$i]->addChild($fname, $fvalue);
             }
         }
         $cn_data = \cn\processor\Factory::make($fields)->data();
         foreach ($cn_data as $name => $value) {
             $name = \htmlspecialchars($name);
             $value = \htmlspecialchars($value);
             $this->xml->channel->item[$i]->addChild($name, $value);
         }
         unset($this->xml->channel->item[$i]->description[0]);
         if (!\util\Utility::isValidImage($imgurl)) {
             $imgurl = "";
         }
         $this->xml->channel->item[$i]->addChild('cover', $imgurl);
     }
 }
예제 #7
0
 function __construct()
 {
     parent::__construct();
 }
예제 #8
0
파일: Dribbble.php 프로젝트: xurble/pubwich
 public function __construct($config)
 {
     parent::__construct($config);
 }