Plugin Directory

Changeset 2303264


Ignore:
Timestamp:
05/12/2020 09:12:47 AM (6 years ago)
Author:
bobcares_plugins
Message:

tagging version 1.3

Location:
daily-quotes
Files:
32 added
2 edited

Legend:

Unmodified
Added
Removed
  • daily-quotes/trunk/class-mashape-quote.php

    r1713013 r2303264  
    2929        require_once 'unirest-php-master/src/Unirest.php';
    3030
    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];
    3936
    4037        // 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;   
    4441        } else {
    4542            $author = '';
  • daily-quotes/trunk/readme.txt

    r1713013 r2303264  
    44Donate link: http://bobcares.com/
    55Requires at least: 3.0.1
    6 Tested up to: 4.8.1
    7 Stable tag: 1.2
     6Tested up to: 5.4.0
     7Stable tag: 1.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7878
    7979== Changelog ==
     80= 1.3 =
     81* Fetch the quote from Rapid API
     82
    8083= 1.2 =
    8184* Solve the quote display
Note: See TracChangeset for help on using the changeset viewer.