Changeset 2303264
- Timestamp:
- 05/12/2020 09:12:47 AM (6 years ago)
- Location:
- daily-quotes
- Files:
-
- 32 added
- 2 edited
-
tags/1.3 (added)
-
tags/1.3/class-mashape-quote.php (added)
-
tags/1.3/css (added)
-
tags/1.3/css/styles.css (added)
-
tags/1.3/daily-quotes.php (added)
-
tags/1.3/readme.txt (added)
-
tags/1.3/unirest-php-master (added)
-
tags/1.3/unirest-php-master/.editorconfig (added)
-
tags/1.3/unirest-php-master/.gitignore (added)
-
tags/1.3/unirest-php-master/.travis.yml (added)
-
tags/1.3/unirest-php-master/LICENSE (added)
-
tags/1.3/unirest-php-master/README.md (added)
-
tags/1.3/unirest-php-master/composer.json (added)
-
tags/1.3/unirest-php-master/phpunit.xml (added)
-
tags/1.3/unirest-php-master/src (added)
-
tags/1.3/unirest-php-master/src/Unirest (added)
-
tags/1.3/unirest-php-master/src/Unirest.php (added)
-
tags/1.3/unirest-php-master/src/Unirest/Exception.php (added)
-
tags/1.3/unirest-php-master/src/Unirest/Method.php (added)
-
tags/1.3/unirest-php-master/src/Unirest/Request (added)
-
tags/1.3/unirest-php-master/src/Unirest/Request.php (added)
-
tags/1.3/unirest-php-master/src/Unirest/Request/Body.php (added)
-
tags/1.3/unirest-php-master/src/Unirest/Response.php (added)
-
tags/1.3/unirest-php-master/tests (added)
-
tags/1.3/unirest-php-master/tests/Unirest (added)
-
tags/1.3/unirest-php-master/tests/Unirest/BodyTest.php (added)
-
tags/1.3/unirest-php-master/tests/Unirest/RequestTest.php (added)
-
tags/1.3/unirest-php-master/tests/Unirest/ResponseTest.php (added)
-
tags/1.3/unirest-php-master/tests/bootstrap.php (added)
-
tags/1.3/unirest-php-master/tests/fixtures (added)
-
tags/1.3/unirest-php-master/tests/fixtures/upload.txt (added)
-
tags/1.3/widget-public.php (added)
-
trunk/class-mashape-quote.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
daily-quotes/trunk/class-mashape-quote.php
r1713013 r2303264 29 29 require_once 'unirest-php-master/src/Unirest.php'; 30 30 31 // Use mashape andrux api to get the daily quotes. 32 $response = Unirest\Request::post("https://andruxnet-random-famous-quotes.p.mashape.com/?cat=famous&count=1", // Mashape andrux endpoint url 33 array( 34 "X-Mashape-Key" => "UF1qQWABMWmsheDZvKPp7rUNOdKsp1dAqmmjsnMwQppBkfBjJw", // Mashape andrux API key 35 "Content-Type" => "application/x-www-form-urlencoded", 36 "Accept" => "application/json" 37 ) 38 ); 31 // Use Rapid API to get the daily quotes. 32 $jsonData = file_get_contents("https://type.fit/api/quotes"); 33 $response = json_decode($jsonData); 34 $randomKey = array_rand($response, 1); 35 $response = $response[$randomKey]; 39 36 40 37 // If response is success 41 if ( $response->code == '200') {42 $quote = $response-> body->quote;43 $author = $response-> body->author;38 if (isset($response)) { 39 $quote = $response->text; 40 $author = $response->author; 44 41 } else { 45 42 $author = ''; -
daily-quotes/trunk/readme.txt
r1713013 r2303264 4 4 Donate link: http://bobcares.com/ 5 5 Requires at least: 3.0.1 6 Tested up to: 4.8.17 Stable tag: 1. 26 Tested up to: 5.4.0 7 Stable tag: 1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 78 78 79 79 == Changelog == 80 = 1.3 = 81 * Fetch the quote from Rapid API 82 80 83 = 1.2 = 81 84 * Solve the quote display
Note: See TracChangeset
for help on using the changeset viewer.