Wikipedia Easy Search Review
Introduction
Have you ever wondered how Facebook generates pages with Wikipedia information or how Google displays Wikipedia data alongside search results? I did. And, I was determined to find a way to make it possible for others to integrate Wikipedia articles into their web pages. After studying the Wikipedia API documentation and completing a custom project for a client, I created "Wikipedia Easy Search", a PHP script that makes it easy to integrate Wikipedia data into your website or web page.
Features
Wikipedia Easy Search is a powerful PHP script that utilizes the Wikipedia API to provide a range of features, including:
- Easy configuration and editing, even for basic PHP users
- View images within pages or as separate pages
- Navigate through HTML pages with clickable links
- Customize the default search language
- Single configuration file for basic settings and functions
- Search inside the Wikipedia database
- View articles in plain text and HTML
- Get main thumb images for plain text pages
Change Log
The script has undergone several updates since its initial release in 2017, with the most recent updates in 2018. The change log highlights the improvements and additions made to the script, including:
- Initial release (2017-04-27)
- Multi-lingual pages and search (2017-05-02)
- Unicode issues for search results (2017-06-06)
- SEO-friendly URLs for HTML and plain text pages (2018-04-24)
- Default language change option with pagination count customization (2018-06-17)
- Introducing both SEO-friendly and non-SEO-friendly versions (2018-06-17)
Score: 4.56
Overall, Wikipedia Easy Search is an excellent PHP script that makes it easy to integrate Wikipedia data into your website or web page. With its ease of use, customization options, and regular updates, this script is a great choice for anyone looking to enhance their website with Wikipedia content.
User Reviews
Be the first to review “Wikipedia Easy Search – Wikipedia API Based PHP Script”
Introduction:
The Wikipedia Easy Search is a user-friendly PHP script that utilizes the power of the Wikipedia API to provide efficient and accurate search results for your WordPress website or any PHP-based website. This script makes it easier to integrate Wikipedia-like search capabilities in your website without requiring you to invest a lot of time in developing such a feature. This tutorial guides you through the setup and installation process of the Wikipedia Easy Search - Wikipedia API-Based PHP Script.
Installation and Prerequisites:
- php: The PHP version should be more than 5.0.
- Wikipedia API: You require a Wikipedia API, which would be used to communicate with WikiPedia Database. Note that the API provided by
https://en.wikipedia.org/w/api.php
is used in the examples below (you can use another API if applicable). - Download the wiki-search.php script:
You must download the wiki-search.php
and wiki.search.php
libraries of the script from your preferred version control system and place this in your project or folder.
Example of how wiki-search
& wiki
files arrangement:
- wiki-master
- wiki.php
- wiwiki.php
- index
-- index.php
Then, update the wiki-api.php path
in index.php
configuration file.
Tutorial-Setting up your Wikipedia-like Search:
STEP 1:Set up the API (Application Programmer Interface)
The most important information you need in order for the script to correctly communicate. The Wikipedia provides an external API that can return data easily. Here the API (Application Programmer Interface)
1.- First, log in https://meta.wikimedia.org/api/rest_v1.0 2.- Next, it will redirect to https ://en.wikipedia.org/w/api.php
Example of Query: https: //api.wikimedia.org rest_v 1.0 wikitests/ query
- wikitests
- 'query'
- pageid=1 : http: //192.108.35.5./w/pagelimited/1321
- For en.wikipedia.org./w/call.php is here the site it will
We http://en.wikipedia.org/w api.php and http/w/api.php .
STEP 1: Setting and Configuring:
1. You'll 1 place have your & 'host' URL ( like http://en.wikipedia.org/w. )& you need 'prefix' wiki . For most cases http en.wikipedia org>w . or http>w api.
2) There is 'type' parameter, by default 'opensearch '. You'd 're see this in wiki . ' to see available api . If you is not there an error of the `type 1. is' default . 4 ) 'lang'. You, for example, & 'en'. 'lang' variable used for language 'output' option , ' xml' or 'javascript' example 'xml ' .If you . ' max results'.
8 ' : You' .
1 1 .For it . 11 www . '.
STEP 2
Install the Script:
This step entails placing the downloaded Wikipedia Easy Search script in your web server along with the necessary library files.
wiki-search
:
<?php
error_reporting (E_All);
# ' http://' 'en', default .
# Wikipedia language .
# Search http://en.wikiap .
$output == 'xml'. ' wiki . or 'javas ; 'php . you .
require_once '' .PHP .END wiwiki.php .
$config = include '' wiwiki.php config .
$json = ( json.decode ) ( json decoder ) ( ( )' .
print '';
print http .E ' HTTP/100 . You .
.
.
.
' '';
.
.
end - wiwiki
STEP 4: Using a PHP Script that Utilized the Wikipedia API:
index.ph
:
<html>
<table>
<td>
Result
<form>
First Name: Search <textbox name/search >
<input name/search Submit type > <
</form >
.</table>
</html
// Get data from Wiki .
echo '';
Here is a complete settings example for Wikipedia Easy Search - Wikipedia API Based PHP Script:
API Settings
You need to get an API key from Wikipedia. You can get it from https://www.mediawiki.org/wiki/API:Main_page#API_keys. Here is how to set it:
api_key = "your_api_key_here";
Wikipedia Search Settings
You can configure the search settings to your liking. Here is an example:
search_types = array("article", "category", "file", "help", "portal", "template", "talk"); search_limit = 10; search_offset = 0;
Results Display Settings
You can customize how the results are displayed. Here is an example:
display_results = true; display_links = true; display_images = true;
Language Settings
You can set the default language for the search results. Here is an example:
default_language = "en";
Other Settings
You can set the base URL for the Wikipedia API and the cache duration. Here is an example:
base_url = "https://en.wikipedia.org/w/api.php"; cache_duration = 3600;
Here are the features extracted from the Wikipedia Easy Search Wikipedia API Based PHP Script:
- Wikipedia API based, PHP Script: The script uses Wikipedia API to retrieve data.
- Easy to configure and Edit: The script is designed to be easy to understand and edit, even for basic PHP users.
- View Images inside pages and as Separate page after clicking on it.: The script allows users to view images within a page or as a separate page.
- Navigate withing HTML page though clickable links: The script provides clickable links for navigation within an HTML page.
- Facility to Customize Default Search Language at Configuration: Users can customize the default search language at the configuration level.
- Single Configuration file to have basic settings and functions: The script has a single configuration file that contains basic settings and functions.
- Search inside Wikipedia database: The script allows users to search inside the Wikipedia database.
- View articles: The script provides the ability to view Wikipedia articles.
- View articles as Plain text and HTML: The script allows users to view articles in both plain text and HTML formats.
- Get main thumb image to plain text page: The script provides the ability to get the main thumbnail image for a page.
Additionally, the script has a changelog that lists updates made to the script, including:
- 2017-04-27: Initial Release
- 2017-05-02: Multi Lingual Pages and Search
- 2017-06-06: Unicode Issues for search Results
- 2018-04-24: SEO Friendly URL for HTML and Plain Text pages
- 2018-06-17: Default Language change option with pagination count customization option
- 2018-06-17: Introducing both SEO friendly and Non-SEO friendly versions
$13.00
There are no reviews yet.