Plugin Directory

Changeset 2208598


Ignore:
Timestamp:
12/09/2019 01:32:10 PM (6 years ago)
Author:
thomask777
Message:

Changed to new bibleversion.com api (to get api key)

Location:
link-to-bible/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • link-to-bible/trunk

    • Property svn:ignore
      •  

        old new  
        11test.php
        22test
         3link-to-bible.iml
         4.idea
  • link-to-bible/trunk/ltb.php

    r1716291 r2208598  
    33 * Plugin Name: Link To Bible
    44 * Description: Automatically links bible references in posts to the appropriate bible verse(s) at bibleserver.com
    5  * Version: 2.5.5
     5 * Version: 2.5.6
    66 * Plugin URI: https://wordpress.org/extend/plugins/link-to-bible/
    77 * Author: Thomas Kuhlmann
    8  * Author URI: http://oss.thk-systems.de
     8 * Author URI: http://www.thk-systems.de
    99 * Min WP Version: 3.2.1
    10  * Max WP Version: 4.8.1
     10 * Max WP Version: 5.3.0
    1111 * Text Domain: ltb
    1212 */
     
    256256
    257257function ltb_retrieve_apikey() {
    258     $params = array (
    259             'apikey_content' => get_option ( 'siteurl' ),
    260             'apikey_send' => 'API-Key+generieren'
    261     );
    262     $html = ltb_http_post_request ( "https://www.bibleserver.com/webmasters/index.php#apikey", $params );
    263     if (! $html)
    264         return null; // Connection error
    265    
    266     $pattern = "/<input.*name=\"apikey_result\".*value=\"(.+)\".*\/>/";
    267     if (preg_match ( $pattern, $html, $matches )) {
    268         return $matches [1];
    269     } else {
    270         return null;
    271     }
    272 }
    273 
     258    $params = array(
     259        'domain' => get_option('siteurl'),
     260    );
     261    $html = ltb_http_post_request("https://www.bibleserver.com/api/webmasters/key", $params);
     262    if (!$html && strpos($html, 'error') !== false) {
     263        return null; // Connection error
     264    }
     265
     266    $html = json_decode($html, true);
     267
     268    return $html['data']['api_key'];
     269}
    274270// ---------------------------------------------
    275271// --------------- DATA ------------------------
  • link-to-bible/trunk/readme.txt

    r1881415 r2208598  
    33Tags: bible, bible verse, bible reference, bibleserver.com, bibelvers, bibel, bibelstelle
    44Requires at least: 3.2.1
    5 Tested up to: 4.9.6
    6 Stable tag: 2.5.5
     5Tested up to: 5.3.0
     6Stable tag: 2.5.6
    77License: GPLv3 or later
    88License URI: https://www.gnu.org/copyleft/gpl.html
     
    6060
    6161== Changelog ==
     62
     63= 2.5.6 =
     64
     65- Changed to new bibleversion.com api (to get api key)
    6266
    6367= 2.5.5 =
Note: See TracChangeset for help on using the changeset viewer.