-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathexample.php
77 lines (61 loc) · 2.02 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/*
// Required > PHP 5
// Include the simple_html_dom library
// Download from http://kaz.dl.sourceforge.net/project/simplehtmldom/simplehtmldom/1.5/simplehtmldom_1_5.zip
// Manual http://simplehtmldom.sourceforge.net/manual.htm
// file_get_contents() issue, use PHP-CURL and send the results in to str_get_html
//
//
// Refer respective Search Engines TOC for further implementations
//
// Easy to Extend remaining search engines (baidu,ebay,torrentz,books)
// Change "linkDomId" based on your requirements
//
// Usage : http://localhost/xampp/search_engine.php?q=phparray
*/
include('simple_html_dom.php');
include('search_engine_crawler.php');
/* Search Query */
$qry = (@$_GET['q']) ? ($_GET['q']) : "ngiriraj.com";
$Google = new search_engine_crawler;
$Google->searchEngineName="Google";
$Google->q = $qry;
$Google->maxcount = "20";
$Google->start = "start";
$Google->searchEnginelink="http://www.google.com/custom?q=";
$Google->linkDomId="h2.r";
echo $Google->SimpleCrawler();
$Bing = new search_engine_crawler;
$Bing->searchEngineName="Bing";
$Bing->q = $qry;
$Bing->maxcount = "20";
$Bing->start = "first";
$Bing->searchEnginelink="http://www.bing.com/search?q=";
$Bing->linkDomId="div.sb_tlst>h3";
echo $Bing->SimpleCrawler();
$Yahoo = new search_engine_crawler;
$Yahoo->searchEngineName="Yahoo";
$Yahoo->q = $qry;
$Yahoo->maxcount = "20";
$Yahoo->start = "b";
$Yahoo->searchEnginelink="http://in.search.yahoo.com/search;_ylt=A2oKmKiQvehSHDcAszm6HAx.?p=";
$Yahoo->linkDomId="h3";
echo $Yahoo->SimpleCrawler();
$Amazon = new search_engine_crawler;
$Amazon->searchEngineName="Amazon";
$Amazon->q = $qry;
$Amazon->maxcount = "20";
$Amazon->start = "page";
$Amazon->searchEnginelink="http://www.amazon.com/s?ie=UTF8&field-keywords=";
$Amazon->linkDomId="div.imageBox";
echo $Amazon->SimpleCrawler();
$Ask = new search_engine_crawler;
$Ask->searchEngineName="Ask.com";
$Ask->q = $qry;
$Ask->maxcount = "20";
$Ask->start = "page";
$Ask->searchEnginelink="http://www.ask.com/web?q=";
$Ask->linkDomId="div.durl";
echo $Ask->SimpleCrawler();
?>