Changeset 533328
- Timestamp:
- 04/19/2012 08:50:17 AM (14 years ago)
- Location:
- spotify-embed-creator/trunk
- Files:
-
- 3 edited
-
Api/Spotify-Request-handler.php (modified) (2 diffs)
-
Readme.txt (modified) (2 diffs)
-
Spotify-Embed-Creator.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
spotify-embed-creator/trunk/Api/Spotify-Request-handler.php
r531922 r533328 10 10 if ( isset($searchtype) && isset($searchquery) ) 11 11 { 12 $response_list = array();13 12 // get the response 14 $url = "http://ws.spotify.com/search/1/".$searchtype.".json?q=".$searchquery; 15 $curl; 16 $curl = curl_init(); 17 18 curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); 19 curl_setopt($curl, CURLOPT_HEADER, false); 20 curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 21 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 22 curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 23 curl_setopt($curl, CURLOPT_URL, $url); 24 25 $response = json_decode(curl_exec($curl)); 26 curl_close($curl); 13 $url = "http://ws.spotify.com/search/1/".$searchtype.".json?q=".$searchquery; 14 if( function_exists('curl_version') == "Enabled" ) 15 { 16 $curl; 17 $curl = curl_init(); 18 19 curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); 20 curl_setopt($curl, CURLOPT_HEADER, false); 21 curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); 22 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 23 curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); 24 curl_setopt($curl, CURLOPT_URL, $url); 25 26 $response = json_decode(curl_exec($curl)); 27 curl_close($curl); 28 }else{ 29 $res = file_get_contents($url); 30 $response = json_decode($res); 31 } 27 32 // write it as json 28 33 header('Cache-Control: no-cache, must-revalidate'); … … 41 46 $response = array('error' => true, 'message' => 'please login'); 42 47 header('HTTP/1.1 500 Internal Server Error'); 43 } 48 } 44 49 45 echo json_encode($response); 50 echo json_encode($response); 46 51 ?> -
spotify-embed-creator/trunk/Readme.txt
r533079 r533328 4 4 Requires at least: 3.0 5 5 Tested up to: 3.3 6 Stable tag: 1.0. 26 Stable tag: 1.0.3 7 7 8 8 Search for Album or Track on Spotify and create a Spotify Play Button. … … 35 35 == Changelog == 36 36 37 = 1.0.3 = 38 * Uses file_get_contents() if curl isn't installed 39 37 40 = 1.0.2 = 38 41 * Changed name on the shortcode function due to incompatibility with another plugin -
spotify-embed-creator/trunk/Spotify-Embed-Creator.php
r533266 r533328 5 5 Plugin URI: http://slowmove.se/wordpress-plugin-spotify-embed-creator/ 6 6 Description: Search for Album or Song on Spotify and create a Spotify Play Button 7 Version: 1.0. 27 Version: 1.0.3 8 8 Author: Erik Johansson 9 9 Author URI: http://slowmove.se
Note: See TracChangeset
for help on using the changeset viewer.