Changeset 158647
- Timestamp:
- 09/28/2009 05:09:11 PM (17 years ago)
- Location:
- nitwpress/trunk
- Files:
-
- 3 edited
-
nitwpress.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
twitter.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nitwpress/trunk/nitwpress.php
r158624 r158647 6 6 Author: sakuratan 7 7 Author URI: http://sakuratan.biz/ 8 Version: 0.9.2. 48 Version: 0.9.2.5 9 9 */ 10 10 -
nitwpress/trunk/readme.txt
r158608 r158647 5 5 Requires at least: 2.7.0 6 6 Tested up to: 2.8.4 7 Stable tag: 0.9.2. 47 Stable tag: 0.9.2.5 8 8 9 9 A Twitter client widget. … … 22 22 23 23 == Changelog == 24 25 = 0.9.2.5 = 26 * Using cURL options for following location HTTP header. 27 * Checking XML error for API result. 24 28 25 29 = 0.9.2.4 = -
nitwpress/trunk/twitter.php
r158607 r158647 73 73 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 74 74 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); 75 curl_setopt($ch, CURLOPT_AUTOREFERER, true); 76 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 77 curl_setopt($ch, CURLOPT_MAXREDIRS, 10); 75 78 curl_setopt($ch, CURLOPT_URL, 76 79 'http://twitter.com/statuses/user_timeline.xml'); 77 80 curl_setopt($ch, CURLOPT_USERPWD, "{$options['username']}:{$options['password']}"); 78 81 $ctx = curl_exec($ch); 82 if (!$ctx) { 83 curl_close($ch); 84 return false; 85 } 79 86 $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 80 87 curl_close($ch); 81 if (!$ctx)82 return false;83 88 if ($code != 200) { 84 89 trigger_error("Twitter api returns error with {$code}", … … 86 91 return false; 87 92 } 88 93 if (!preg_match('/^<\?xml/', $ctx)) { 94 trigger_error("Got none XML results", E_USER_WARNING); 95 return false; 96 } 89 97 90 98 // Strip and save result XML
Note: See TracChangeset
for help on using the changeset viewer.