PHP Classes

Not getting script to work...

Recommend this page to a friend!

      PHP Wikipedia API  >  All threads  >  Not getting script to work...  >  (Un) Subscribe thread alerts  
Subject:Not getting script to work...
Summary:Blank output
Messages:3
Author:Terry Woody
Date:2020-04-16 15:20:17
 

  1. Not getting script to work...   Reply   Report abuse  
Picture of Terry Woody Terry Woody - 2020-04-16 15:20:17
Hey, nice little class!

I have created a demo and not getting results back. Just a blank page. My demo is simple:

require_once('wikibot.class.php');

$bot_config = [
'url'=>'https://en.wikipedia.org',
'username'=>'myusernmae',
'password'=>'mypassword'
];

$bot = new lm_wiki_bot($bot_config);

$bot->search([
'offset'=>10,
'limit'=>10,
'sort'=>'last_edit_desc',
'keyword'=>'cellular'
]);

Maybe you could create a simple demo.php (leaving usersname/pass blank of course) and show how script works?

I cannot figure out how to get the content, reason for blank page?

Thanks for sharing your class.

  2. Re: Not getting script to work...   Reply   Report abuse  
Picture of Arash Soleimani Arash Soleimani - 2020-04-17 19:36:08 - In reply to message 1 from Terry Woody
Hi Terry,

Thanks for using this class. I add 2 demo files to the package and update the Readme file.

You just have to change this line:

$bot->search([...

with this:

$data = $bot->search([...

it returns an array and then you can test it with print_r($data);

Let me know if you need any help or want new functions ;)

  3. Re: Not getting script to work...   Reply   Report abuse  
Picture of Terry Woody Terry Woody - 2020-04-18 02:42:50 - In reply to message 2 from Arash Soleimani
Wonderful, thank you.

Did not understand how to get output. Now must experiment with formatting the output search results.

Stay safe and healthy!

Woody