Changeset 698523
- Timestamp:
- 04/16/2013 01:37:56 PM (13 years ago)
- Location:
- live-stream-badger/trunk
- Files:
-
- 3 edited
-
class-query-twitch.php (modified) (1 diff)
-
class-stream-dto.php (modified) (1 diff)
-
stream-status-updater.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
live-stream-badger/trunk/class-query-twitch.php
r697408 r698523 37 37 */ 38 38 function get_results() { 39 error_log("Executing Twitch query: " . $this->query_string); 40 $json_content = file_get_contents($this->query_string); 41 $j = json_decode($json_content, TRUE); 39 $response = wp_remote_retrieve_body( wp_remote_get( $this->query_string ) ); 40 if ( empty( $response ) ) 41 return NULL; 42 43 $j = json_decode($response, TRUE); 42 44 return $j; 43 45 } -
live-stream-badger/trunk/class-stream-dto.php
r698511 r698523 59 59 $sb = new Stream_DTO(); 60 60 $sb -> url = $stream_url; 61 $sb -> channel_name = esc_attr($channel_name); 61 62 // Channel name should be always lowercase 63 $sb -> channel_name = strtolower(esc_attr($channel_name)); 62 64 return $sb; 63 65 } -
live-stream-badger/trunk/stream-status-updater.php
r697408 r698523 65 65 $j_results = array( ); 66 66 $json = $query->get_results( ); 67 if ( empty( $json ) ) 68 return; 69 67 70 foreach ( $json as $j ) { 68 71 $j_live_user_split = explode( 'live_user_', $j['name'] ); … … 72 75 continue; 73 76 77 // Store results with channel key lower cased 78 $j_channel_name = strtolower($j_channel_name); 74 79 $j_results[$j_channel_name] = $j; 75 80 }
Note: See TracChangeset
for help on using the changeset viewer.