Changeset 854508
- Timestamp:
- 02/10/2014 02:34:54 AM (12 years ago)
- Location:
- wpinstagram-images-widget/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
class/InstagramCrawler.php (modified) (5 diffs)
-
wpinstagram-images-widget.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wpinstagram-images-widget/trunk/README.txt
r848017 r854508 3 3 Requires at least: 3.5 4 4 Tested up to: 3.6 beta 3 5 Stable tag: 1.2. 55 Stable tag: 1.2.6 6 6 7 7 Instagram Images Widget get your most recent activity at Instagram and display them in a Widget. … … 61 61 == Changelog == 62 62 63 v.1.2.6 - Bugfix 64 63 65 v.1.2.5 - Bugfix 64 66 -
wpinstagram-images-widget/trunk/class/InstagramCrawler.php
r848017 r854508 8 8 9 9 public static function get( $username ){ 10 11 $username = preg_replace('/[@\s]/','',$username); 10 12 11 13 if( empty($username) ){ … … 51 53 if(!is_null($script)) break; 52 54 53 if( preg_match("#(window\.(_jscalls|_sharedData))#i",$item->innertext) ){ 55 56 if( preg_match("/(window\.(_jscalls|_sharedData))/i",$item->innertext) ){ 54 57 $script = $item->innertext; 55 58 break; … … 61 64 if( !is_null($script) ){ 62 65 63 preg_match_all("#(\"userMedia\"\:)(\[)(.*?)(\]\,\"prerelease\")#isU",$script,$matches); 66 67 preg_match_all('/(window\._(sharedData|jscall)[\s=]+[^{\"](.*?\})(\;))/isU',$script,$matches); 64 68 65 69 $data = isset($matches[3][0]) ? $matches[3][0] : null; … … 67 71 if( !is_null($data) ){ 68 72 69 $results_json = "[".$data."]"; 70 $results = json_decode($results_json,true); 73 $results = json_decode($data,true); 71 74 72 75 if(json_last_error() !== JSON_ERROR_NONE){ … … 74 77 } 75 78 76 if(is_array($results)){ 77 foreach( $results as $current=>$result ) { 79 if(!isset($results['entry_data']['UserProfile'][0])){ 80 return; 81 } 82 83 $userProfile = $results['entry_data']['UserProfile'][0]; 84 85 if(!isset($userProfile['userMedia'])){ 86 return; 87 } 88 89 $userMedia = $userProfile['userMedia']; 90 91 92 if(isset($userMedia) && is_array($userMedia)){ 93 foreach( $userMedia as $current=>$result ) { 78 94 79 95 if($current > 5) break; -
wpinstagram-images-widget/trunk/wpinstagram-images-widget.php
r848017 r854508 4 4 * Plugin URI: http://eduardostuart.com.br/ 5 5 * Description: Instagram Images Widget get your most recent activity at Instagram and display them in a Widget. 6 * Version: 1.2. 56 * Version: 1.2.6 7 7 * Author: Eduardo Stuart 8 8 * Author URI: http://eduardostuart.com.br
Note: See TracChangeset
for help on using the changeset viewer.