-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathppc-cli.php
25 lines (20 loc) · 825 Bytes
/
ppc-cli.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
<?php
require_once('ppc_search.php');
//options
$swiches = getopt('s:p:m:');
$search_term = isset($swiches['s']) ? $swiches['s'] : null;
$party = isset($swiches['p']) ? $swiches['p'] : null;
$mode = isset($swiches['m']) ? $swiches['m'] : 'web';
if(!isset($search_term) || $search_term == ''){
print " \n\n";
print "Search google for PPC names, their constituency and a search term of your choosing\n\n";
print "-s term to search for(requried)\n";
print "-p name of the party (defaults to all)\n";
print "-m search mode, web, blogs or video (defaults to web)\n";
print " \n\n";
exit();
}
$ppc_search = new PPCSearch($party);
$results = $ppc_search->search($search_term, $mode, true);
vardump($results);
?>