Changeset 104
- Timestamp:
- 03/02/08 19:55:58 (9 months ago)
- Files:
-
- trunk/Phergie/Plugin/FeedTicker.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/FeedTicker.php
r87 r104 144 144 $retrieved = array(); 145 145 146 $context = stream_context_create(array('http' => array( 147 'timeout' => 5, 148 'user_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b3) Gecko/2008020514 Firefox/3.0b3' 149 ))); 150 146 151 // Retrieve each feed 147 152 foreach ($this->feeds as $id => $feed) { 148 153 list ($url, $chans) = $feed; 149 154 150 $content = file_get_contents($url);155 $content = @file_get_contents($url, null, $context); 151 156 if (empty ($content)) { 157 $this->debug('Feed empty: ' . $url); 152 158 continue; 153 159 } … … 167 173 } 168 174 } else { // Trouble 169 continue; 175 $this->debug('Feed format unrecognized: ' . $url); 176 continue; 170 177 } 171 178 } … … 192 199 } 193 200 } 194 }195 // Cache current data for next run196 $this->cache = $retrieved;201 // Cache current data for next run 202 $this->cache[$id] = $articles; 203 } 197 204 } 198 205