Changeset 259 for trunk/Phergie/Plugin
- Timestamp:
- 07/02/08 02:55:37 (5 months ago)
- Files:
-
- trunk/Phergie/Plugin/Acronym.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Acronym.php
r255 r259 139 139 "Accept-Language: en-us,en;q=0.8\r\n". 140 140 "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n". 141 "Referer: http:// www.acronymfinder.com/\r\n",141 "Referer: http://acronyms.thefreedictionary.com/\r\n", 142 142 ) 143 143 ); 144 144 $context = stream_context_create($opts); 145 $url = 'http:// www.acronymfinder.com/af-query.asp?Acronym=' . urlencode($acronym) . '&Find=find&string=exact';145 $url = 'http://acronyms.thefreedictionary.com/' . urlencode($acronym); 146 146 $contents = @file_get_contents($url, false, $context); 147 147 148 148 if (empty ($contents) || 149 strpos($contents, 'no abbreviation matches') !== false || 150 strpos($contents, 'has exceeded the daily query limit') !== false) { 149 strpos($contents, 'Word not found') !== false) { 151 150 $this->randomAction($source); 152 151 return; … … 156 155 157 156 do { 158 $count = preg_match('/<td width="65%"[^>]+>([^<]+)</i', $contents, $match, PREG_OFFSET_CAPTURE, $offset);157 $count = preg_match('/<td>([^<]+)</i', $contents, $match, PREG_OFFSET_CAPTURE, $offset); 159 158 if ($count == 1) { 160 159 $matches[] = html_entity_decode($match[1][0]);