本文整理匯總了PHP中scraperwiki::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP scraperwiki::select方法的具體用法?PHP scraperwiki::select怎麽用?PHP scraperwiki::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scraperwiki
的用法示例。
在下文中一共展示了scraperwiki::select方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: scrape_related
function scrape_related($url)
{
$exists = scraperwiki::select("* from pages where url = '{$url}'");
if (count($exists)) {
print_r($exists);
return;
}
global $counter;
$counter++;
scraperwiki::save_sqlite(array('url'), array('count' => $counter, 'url' => $url), 'pages');
$html_content = scraperwiki::scrape($url);
$html = str_get_html($html_content);
foreach ($html->find('div.related a') as $related) {
scrape_related('http://tunein.com' . $related->href);
}
}
示例2: fourOhFour
}
}
return null;
}
# Check for pages with no usable data
function fourOhFour($html)
{
if (strpos($html, 'Home not available', 1200) !== false) {
return true;
}
return false;
}
$blacklist = array();
# get an array of the cottage data to scrape
scraperwiki::attach("hoseasons_summary");
$cottData = scraperwiki::select(" COTTAGE_ID, COTTAGE_URL, SLEEPS, BEDROOMS, PETS,COTTAGE_NAME, PRICE_LOW, PRICE_HIGH from 'hoseasons_summary'.SWDATA order by COTTAGE_URL");
$placeholder = scraperwiki::get_var("cottURL");
if ($placeholder != "") {
$index = searchForId($placeholder, $cottData);
$cottData = array_splice($cottData, $index);
}
require 'scraperwiki/simple_html_dom.php';
$dom = new simple_html_dom();
foreach ($cottData as $value) {
$highPrice = "";
$lowPrice = "";
$found = 0;
$count = 0;
scraperwiki::save_var("cottURL", $value['COTTAGE_URL']);
// check the cottage url against the blacklist
foreach ($blacklist as $blItem) {
示例3: array
$routemap = array();
foreach ($routes as $route) {
$routemap[$route['route']]['route'] = $route['route'];
@($routemap[$route['route']]['coords'] .= $route['latitude'] . ',' . $route['longitude'] . ',2357' . "\n");
}
$theroutes = array();
$count = 0;
foreach ($routemap as $a_route) {
$count++;
$r = $a_route['route'];
$c = $a_route['coords'];
$theroutes[] = array('id' => $count, 'route' => $r, 'coords' => $c);
}
scraperwiki::save_sqlite(array("id"), $theroutes);
//Whoops, seems that doing 600 queries in under 80 seconds isn't a smart idea. This scraper attempts to aggregate coordinates into something usable.
scraperwiki::attach("tfl_bus_routes_scraper", "src");
$routes = scraperwiki::select("route, stop_name, latitude, longitude from src.tfl_buses where run = 1 order by sequence asc");
$routemap = array();
foreach ($routes as $route) {
$routemap[$route['route']]['route'] = $route['route'];
@($routemap[$route['route']]['coords'] .= $route['latitude'] . ',' . $route['longitude'] . ',2357' . "\n");
}
$theroutes = array();
$count = 0;
foreach ($routemap as $a_route) {
$count++;
$r = $a_route['route'];
$c = $a_route['coords'];
$theroutes[] = array('id' => $count, 'route' => $r, 'coords' => $c);
}
scraperwiki::save_sqlite(array("id"), $theroutes);
示例4: header
$callback = $_GET['callback'];
if ($callback) {
header("Content-Type: text/javascript; charset=utf8");
echo $callback . "(" . json_encode($alltrips) . ");";
} else {
header("Content-type: application/json");
echo json_encode($alltrips);
}
// {label} {id} {type} {day} {date} {year} {time} {startdate} {latlng} {arasnotaras} {details} {place} {act} {issue} {constitutional} {destf} {address} {days} {destination}
?>
<?php
//$sourcescraper = 'irish_president_engagementstest';
//$s = scraperwiki::scrape($sourcescraper, $limit=250);
// = scraperwiki::attach($sourcescraper, $limit=250);
scraperwiki::attach('irish_president_engagementsjson');
$trips = scraperwiki::select("* from irish_president_engagementsjson.swdata where date > date('now','-7 day');");
$alltrips = array();
foreach ($trips as $trip) {
$tripinfo = $trip["info"];
$triplabel = $trip["label"];
$tripinfo = str_replace('(', '', $tripinfo);
$tripinfo = str_replace(')', ',', $tripinfo);
$triplabel = str_replace('(', '', $triplabel);
$triplabel = str_replace(')', ',', $triplabel);
//print $triplabel;
$trip["info"] = $tripinfo;
$trip["label"] = $triplabel;
$alltrips[] = $trip;
}
//header('Content-type: application/json');
scraperwiki::httpresponseheader('Content-Type', 'application/json', 'charset=utf8');
示例5: foreach
if ($sort == "" || $sort == "category") {
$pCategory = "";
$data = scraperwiki::select("* from repos order by category,name");
foreach ($data as $d) {
$name = $d["name"];
$link = $d["link"];
$category = $d["category"];
if ($category != $pCategory) {
print "<li data-role=\"list-divider\">{$category}</li>";
}
$pCategory = $category;
print "<li><a href=\"?action=detail&link={$link}\" data-rel=\"dialog\">{$name}</a></li>";
}
}
if ($sort == "alphabet") {
$data = scraperwiki::select("* from repos order by name");
foreach ($data as $d) {
$name = $d["name"];
$link = $d["link"];
print "<li><a href=\"?action=detail&link={$link}\" data-rel=\"dialog\">{$name}</a></li>";
}
}
?>
</ul>
</div><!-- /content -->
<div data-role="footer">
<h4>ofxAddons.com</h4>
</div><!-- /footer -->
</div><!-- /page -->
示例6: searchForId
return $txt;
}
function searchForId($id, $array)
{
foreach ($array as $key => $val) {
if ($val['COTTAGE_URL'] === $id) {
return $key;
}
}
return null;
}
$blacklist = array();
$url = "http://www.coastandcountry.co.uk/cottage-details/";
scraperwiki::attach("coastandcountrycouk");
# get an array of the cottage data to scrape
$cottData = scraperwiki::select("COTTAGE_URL, PRICE_HIGH, PRICE_LOW from 'coastandcountrycouk'.SWDATA order by COTTAGE_URL");
$placeholder = scraperwiki::get_var("cottID");
if ($placeholder != "") {
$index = searchForId($placeholder, $cottData);
$cottData = array_splice($cottData, $index);
}
require 'scraperwiki/simple_html_dom.php';
$dom = new simple_html_dom();
foreach ($cottData as $value) {
scraperwiki::save_var("cottID", $value['COTTAGE_URL']);
// check the cottage url against the blacklist
foreach ($blacklist as $blItem) {
if ($value['COTTAGE_URL'] == $blItem) {
continue 2;
}
}
示例7: array
// </a>
// <a href="webdata/resources/files/DAS-2015-42 12-09.pdf" onmouseover="self.status='';return true;" target="_blank">164 Roslyn Avenue, Blackmans Bay - Representation expiry date is 25 September 2015</a>
// <br>
// <span style="padding-left:25px;">Subdivision of one lot and balance</span>
//</p>
$record = array();
$addressDateAnchor = $thispara->find('a', 1);
$addressDateText = $addressDateAnchor->plaintext;
$parts = explode(' - Representation expiry date is', $addressDateText);
$record['address'] = htmlspecialchars_decode($parts[0] . ', TAS');
$expiry = $parts[1];
$record['on_notice_to'] = date('Y-m-d', strtotime($expiry));
// Set more_info to the DA page because unfortunately the council takes the PDFs down
// $record['info_url'] = $kcbase . $addressDateAnchor->href;
$record['info_url'] = $dapage;
//there's probably a clever way to do this
$record['council_reference'] = explode(' ', trim(strrchr($kcbase . $addressDateAnchor->href, '/'), '/'))[0];
$descriptionspan = $thispara->find('span', 0);
$record['description'] = htmlspecialchars_decode($descriptionspan->plaintext);
$record['date_scraped'] = date('Y-m-d');
$record['comment_url'] = 'mailto:kc@kingborough.tas.gov.au';
// var_dump($record);
$existingRecords = scraperwiki::select("* from data where `council_reference`='" . $record['council_reference'] . "'");
if (count($existingRecords) == 0) {
print "Saving record " . $record['council_reference'] . "\n";
//print_r ($record);
scraperwiki::save(array('council_reference'), $record);
} else {
print "Skipping already saved record " . $record['council_reference'] . "\n";
}
}
示例8: array
}
####################################################################################################################
####################################################################################################################
####################################################################################################################
####################################################################################################################
$originalPrice = "";
$discountedPrice = "";
$calcPercentage = "";
$discountAmount = "";
$percentage = "";
$i = 0;
$blacklist = array();
$url = "http://www.coastandcountry.co.uk/cottage-details/";
scraperwiki::attach("special_offers_coast_and_country_summary_delete");
# get an array of the cottage data to scrape
$cottData = scraperwiki::select("COTTAGE_URL from 'special_offers_coast_and_country_summary_delete'.SWDATA order by COTTAGE_URL");
$placeholder = scraperwiki::get_var("cottID");
if ($placeholder != "") {
$index = searchForId($placeholder, $cottData);
$cottData = array_splice($cottData, $index);
}
require 'scraperwiki/simple_html_dom.php';
$dom = new simple_html_dom();
foreach ($cottData as $value) {
scraperwiki::save_var("cottID", $value['COTTAGE_URL']);
// check the cottage url against the blacklist
foreach ($blacklist as $blItem) {
if ($value['COTTAGE_URL'] == $blItem) {
continue 2;
}
}
開發者ID:flyeven,項目名稱:scraperwiki-scraper-vault,代碼行數:31,代碼來源:special_offers_coast_and_country_267_single_table.php
示例9: foreach
scraperwiki::attach("lichfield_cathedral_events", "cathedral");
$cathedral = scraperwiki::select("* from cathedral.swdata");
foreach (scraperwiki::select("* from cathedral.swdata") as $record) {
var_dump($record);
die;
}
/*
$insert_ical = array();
$insert_ical['link'] = $insert['link'];
$insert_ical['DTSTART'] = $strt;
$insert_ical['DTEND'] = $strt+86399;
$insert_ical['FREQ'] = "DAILY";
$insert_ical['BYDAY'] = "";
$insert_ical['WKST'] = "MO";
$insert_ical['COUNT'] = round(($nd-$strt)/86400);
$insert_event = array();
$insert_event['name'] = "";
$insert_event['link'] = "";
$insert_venue = array();
$insert_venue['name'] = "";
$insert_venue['postcode'] = "";
$insert_venue['lat'] = "";
$insert_venue['lng'] = "";
$insert_venue['picture'] = "";
*/
scraperwiki::attach("lichfield_cathedral_events", "cathedral");
$cathedral = scraperwiki::select("* from cathedral.swdata");
foreach (scraperwiki::select("* from cathedral.swdata") as $record) {
var_dump($record);
die;
}
示例10: count
<?php
//scraperwiki::sqliteexecute('create table create_test(a text,b text)');
//$val2="insert into create_test values('$name','$id')";
//scraperwiki::sqliteexecute($val2);
$result = scraperwiki::select('* from tagtable');
//$data=$result[0];
//$data['rank']='2';
print count($result);
//scraperwiki::sqliteexecute('create table create_test(a text,b text)');
//$val2="insert into create_test values('$name','$id')";
//scraperwiki::sqliteexecute($val2);
$result = scraperwiki::select('* from tagtable');
//$data=$result[0];
//$data['rank']='2';
print count($result);
示例11: foreach
}
print '</outline>';
}
?>
</body>
</opml>
<?php
# Blank PHP
$sourcescraper = 'sr_p3_poddar';
scraperwiki::attach("sr_p3_poddar");
$programs = scraperwiki::select("distinct progId from sr_p3_poddar.swdata");
print '<?xml version="1.0" encoding="UTF-8"?>';
?>
<opml version="1.1">
<head>
<title>Podsändningar i P3</title>
</head>
<body>
<?php
foreach ($programs as $program) {
print '<outline text="' . $program['progId'] . '">';
$pods = scraperwiki::select("* from sr_p3_poddar.swdata where progId=" . $program['progId'] . " limit 5");
foreach ($pods as $pod) {
print '<outline text="' . $pod['description'] . '" URL="' . $pod['url'] . '" type="audio" />';
}
print '</outline>';
}
?>
</body>
</opml>
示例12: array
<?php
# Blank PHP
/*
// för varje aktie
// för varje mäklare
// för varje rek, starta en månad tillbaka
// jämför rek med kurs när nästa rek inträffar (endast vid ändring av rek), eller nuvarande kurs om endast en rek
*/
require 'scraperwiki/simple_html_dom.php';
$stocks = array("AAK - AarhusKarlshamn" => "SSE36273", "ABB - ABB Ltd" => "SSE3966", "ABB U - ABB Ltd U" => "SSE81849", "ACAN B - Acando B" => "SSE981", "ACAP A - ACAP Invest A" => "SSE20016", "ACAP B - ACAP Invest B" => "SSE20017", "ACOM - A-Com" => "SSE4287", "ACTI - Active Biotech" => "SSE877", "ANOD B - Addnode B" => "SSE3887", "ADDT B - Addtech B" => "SSE14336", "AERO B - Aerocrine B" => "SSE41047", "ALFA - Alfa Laval" => "SSE18634", "ALNX - Allenex" => "SSE37656", "AOIL SDB - Alliance Oil Company SDB" => "SSE40583", "ATEL - AllTele" => "SSE66668", "ANOT - Anoto Group" => "SSE5110", "AWP - Arise Windpower" => "SSE74570", "ARTI B - Artimplant B" => "SSE953", "ASP - Aspiro" => "SSE13291", "ASSA B - ASSA ABLOY B" => "SSE402", "AZN - AstraZeneca" => "SSE3524", "ATCO A - Atlas Copco A" => "SSE45", "ATCO B - Atlas Copco B" => "SSE46", "LJGR B - Atrium Ljungberg B" => "SSE1011", "ALIV SDB - Autoliv SDB" => "SSE47", "AZA - Avanza Bank Holding" => "SSE988", "AVEG B - Avega Group B" => "SSE43396", "AXFO - Axfood" => "SSE4590", "AXIS - Axis" => "SSE5150", "BBTO B - B&B TOOLS B" => "SSE793", "BEGR - BE Group" => "SSE37309", "BEIA B - Beijer Alma B" => "SSE875", "BEIJ B - Beijer B" => "SSE792", "BELE - Beijer Electronics" => "SSE5081", "BRG B - Bergs Timber B" => "SSE891", "BETS B - Betsson B" => "SSE5121", "BILI A - Bilia A" => "SSE794", "BILL - Billerud" => "SSE14922", "BIOG B - BioGaia B" => "SSE959", "BINV - BioInvent International" => "SSE13348", "BIOT - Biotage" => "SSE5209", "BORG - Björn Borg" => "SSE40286", "BEF SDB - Black Earth Farming SDB" => "SSE66922", "BOL - Boliden" => "SSE15285", "BONG - Bong" => "SSE892", "BOUL - Boule Diagnostics" => "SSE82889", "BRIN B - Brinova Fastigheter B" => "SSE22922", "BTS B - BTS Group B" => "SSE13288", "BURE - Bure Equity" => "SSE800", "BMAX - Byggmax Group" => "SSE75712", "CAST - Castellum" => "SSE966", "CATE - Catena" => "SSE34362", "CCC - Cavotec" => "SSE84962", "CDON - CDON Group" => "SSE79303", "CEVI - CellaVision" => "SSE40679", "CSN - Cision" => "SSE1056", "CLAS B - Clas Ohlson B" => "SSE4145", "CLA B - Cloetta B" => "SSE63225", "COA - Coastal Contacts" => "SSE70690", "COIC - Concentric" => "SSE82656", "CCOR B - Concordia Maritime B" => "SSE971", "CNTA - Connecta" => "SSE29954", "CONS B - Consilium B" => "SSE803", "CORE - Corem Property Group" => "SSE66929", "CORE PREF - Corem Property Group Pref" => "SSE74282", "CTT - CTT Systems" => "SSE3081", "CYBE - Cybercom Group" => "SSE4345", "DAG - Dagon" => "SSE19210", "DEDI - Dedicare B" => "SSE81878", "DGC - DGC One" => "SSE56154", "DIAM B - Diamyd Medical B" => "SSE18765", "DIOS - Diös Fastigheter" => "SSE34271", "DORO - DORO" => "SSE896", "DUNI - Duni" => "SSE49775", "DURC B - Duroc B" => "SSE4005", "ECEX - East Capital Explorer" => "SSE49615", "ELAN B - Elanders B" => "SSE897", "ELEC - Electra Gruppen" => "SSE66436", "ELUX A - Electrolux A" => "SSE80", "ELUX B - Electrolux B" => "SSE81", "EKTA B - Elekta B" => "SSE806", "ELOS B - Elos B" => "SSE947", "ENEA - Enea" => "SSE1149", "ENRO - Eniro" => "SSE11046", "ENQ - EnQuest PLC" => "SSE75073", "EPCT - EpiCept" => "SSE32838", "ERIC A - Ericsson A" => "SSE100", "ERIC B - Ericsson B" => "SSE101", "ETX - Etrion" => "SSE78547", "EWRK - eWork Scandinavia" => "SSE72798", "FABG - Fabege" => "SSE861", "FAG - Fagerhult" => "SSE903", "FPAR - Fast Partner" => "SSE980", "BALD B - Fast. Balder B" => "SSE4212", "BALD PREF - Fast. Balder pref" => "SSE82823", "FEEL - Feelgood Svenska" => "SSE5053", "FIX B - Fenix Outdoor B" => "SSE905", "FING B - Fingerprint Cards B" => "SSE4870", "FBAB - FinnvedenBulten" => "SSE82239", "FPIP - FormPipe Software" => "SSE72565", "GETI B - Getinge B" => "SSE812", "GVKO B - Geveko B" => "SSE813", "GHP - Global Health Partner" => "SSE59064", "GUNN - Gunnebo" => "SSE816", "HAKN - Hakon Invest" => "SSE32443", "HLDX - Haldex" => "SSE817", "HAV B - Havsfrun Investment B" => "SSE990", "HEBA B - HEBA B" => "SSE991", "HEMX - Hemtex" => "SSE31293", "HM B - Hennes & Mauritz B" => "SSE992", "HEXA B - Hexagon B" => "SSE819", "HPOL B - HEXPOL B" => "SSE55907", "HIQ - HiQ International" => "SSE3540", "HMS - HMS Networks" => "SSE43302", "HOLM A - Holmen A" => "SSE221", "HOLM B - Holmen B" => "SSE222", "HUFV A - Hufvudstaden A" => "SSE820", "HUFV C - Hufvudstaden C" => "SSE821", "HUSQ A - Husqvarna A" => "SSE34913", "HUSQ B - Husqvarna B" => "SSE34915", "HOGA B - Höganäs B" => "SSE824", "IAR B - I.A.R Systems Group" => "SSE2346", "IS - Image Systems" => "SSE3571", "IFS A - Industrial & Financial Syst. A" => "SSE994", "IFS B - Industrial & Financial Syst. B" => "SSE995", "INDU A - Industrivärden A" => "SSE142", "INDU C - Industrivärden C" => "SSE143", "INDT - Indutrade" => "SSE31308", "ICTA B - Intellecta B" => "SSE941", "IJ - Intrum Justitia" => "SSE18962", "INVE A - Investor A" => "SSE160", "INVE B - Investor B" => "SSE161", "ITAB B - ITAB Shop Concept B" => "SSE56940", "JEEV - Jeeves Information Systems" => "SSE3555", "JM - JM" => "SSE13217", "KABE B - KABE B" => "SSE912", "KAHL - KappAhl" => "SSE33359", "KARO - Karo Bio" => "SSE3927", "KDEV - Karolinska Development B" => "SSE81547", "KINV A - Kinnevik A" => "SSE998", "KINV B - Kinnevik B" => "SSE999", "KLOV - Klövern" => "SSE19459", "KLOV PREF - Klövern pref" => "SSE86345", "KNOW - Know IT" => "SSE3219", "KLED - Kungsleden" => "SSE3546", "LAGR B - Lagercrantz Group B" => "SSE14335", "LAMM B - Lammhults Design Group B" => "SSE1049", "LATO B - Latour B" => "SSE914", "LIAB - Lindab International" => "SSE37400", "LOOM B - Loomis B" => "SSE61536", "LUND B - Lundbergföretagen B" => "SSE1012", "LUMI SDB - Lundin Mining Corporation SDB" => "SSE27709", "LUPE - Lundin Petroleum" => "SSE22335", "LUXO SDB - Luxonen SDB" => "SSE1014", "MEAB B - Malmbergs Elektriska B" => "SSE3223", "MEDA A - Meda A" => "SSE917", "MVIR B - Medivir B" => "SSE1020", "MEKO - Mekonomen" => "SSE4986", "MELK - Melker Schörling" => "SSE37472", "MTRO SDB A - Metro International SDB A" => "SSE12429", "MTRO SDB B - Metro International SDB B" => "SSE12430", "MSAB B - Micro Systemation B" => "SSE85846", "MICR - Micronic Mydata AB" => "SSE4714", "MSON A - Midsona A" => "SSE3921", "MSON B - Midsona B" => "SSE3922", "MIDW A - Midway A" => "SSE834", "MIDW B - Midway B" => "SSE835", "MIC SDB - Millicom Int. Cellular SDB" => "SSE24507", "MOB - Moberg Derma" => "SSE79252", "MTG A - Modern Times Group A" => "SSE3598", "MTG B - Modern Times Group B" => "SSE3599", "MORP B - Morphic Technologies B" => "SSE53228", "MQ - MQ Holding" => "SSE76085", "MSC B - MSC Konsult B" => "SSE1023", "MULQ - MultiQ International" => "SSE4359", "NAXS - NAXS Nordic Access Buyout Fund" => "SSE40342", "NCC A - NCC A" => "SSE837", "NCC B - NCC B" => "SSE838", "NMAN - Nederman Holding" => "SSE40347", "NET B - Net Entertainment NE B" => "SSE62494", "NETI B - Net Insight B" => "SSE3871", "NEWA B - New Wave B" => "SSE920", "NIBE B - NIBE Industrier B" => "SSE921", "NOBI - Nobia" => "SSE19095", "NOLA B - Nolato B" => "SSE923", "NDA SEK - Nordea Bank" => "SSE220", "NOMI - Nordic Mines" => "SSE57018", "NSP B - Nordic Service Partn. Holdings" => "SSE51621", "NN B - Nordnet B" => "SSE4872", "NOTE - NOTE" => "SSE25319", "NOVE - Novestra" => "SSE5116", "NTEK B - NOVOTEK B" => "SSE4000", "OASM - Oasmia Pharmaceutical" => "SSE76461", "ODD - Odd Molly International" => "SSE40936", "OEM B - OEM International B" => "SSE927", "OPCO - Opcon" => "SSE2282", "ORX - Orexo" => "SSE31885", "ORI SDB - Oriflame, SDB" => "SSE24227", "ORTI A - Ortivus A" => "SSE1031", "ORTI B - Ortivus B" => "SSE1032", "PAR - PA Resources" => "SSE34961", "PART - PartnerTech" => "SSE1036", "PEAB B - Peab B" => "SSE928", "PHON - Phonera" => "SSE5000", "POOL B - Poolia B" => "SSE3974", "PREC - Precise Biometrics" => "SSE10751", "PREV B - Prevas B" => "SSE1039", "PRIC B - Pricer B" => "SSE1040", "PACT - Proact IT Group" => "SSE4003", "PROB - Probi" => "SSE27701", "PROE B - Proffice B" => "SSE4208", "PROF B - Profilgruppen B" => "SSE929", "RATO A - Ratos A" => "SSE1044", "RATO B - Ratos B" => "SSE1045", "RAY B - RaySearch Laboratories B" => "SSE1063", "RSOF B - ReadSoft B" => "SSE3967", "RABT B - Rederi AB Transatlantic" => "SSE964", "REJL B - Rejlerkoncernen" => "SSE37758", "REZT - Rezidor Hotel Group" => "SSE37352", "RNBS - RNB RETAIL AND BRANDS" => "SSE13467", "RROS - Rottneros" => "SSE930", "RTIM B - Rörvik Timber B" => "SSE1050", "SAAB B - SAAB B" => "SSE1051", "SAGA - Sagax" => "SSE43045", "SAGA PREF - Sagax pref" => "SSE43046", "SAND - Sandvik" => "SSE4928", "SAS - SAS" => "SSE13557", "SCA A - SCA A" => "SSE322", "SCA B - SCA B" => "SSE323", "SCV A - SCANIA A" => "SSE260", "SCV B - SCANIA B" => "SSE261", "SEB A - SEB A" => "SSE281", "SEB C - SEB C" => "SSE282", "SECT B - SECTRA B" => "SSE3083", "SECU B - Securitas B" => "SSE401", "SMF - Semafo" => "SSE84981", "SEMC - Semcon" => "SSE1054", "SENS - Sensys Traffic" => "SSE12241", "SIGM B - Sigma B" => "SSE14531", "SINT - SinterCast" => "SSE1058", "SKA B - Skanska B" => "SSE283", "SKF A - SKF A" => "SSE284", "SKF B - SKF B" => "SSE285", "SKIS B - SkiStar B" => "SSE939", "SOF B - Softronic B" => "SSE1546", "SSAB A - SSAB A" => "SSE300", "SSAB B - SSAB B" => "SSE301", "STFY - StjärnaFyrkant AB" => "SSE1007", "STE A - Stora Enso A" => "SSE2169", "STE R - Stora Enso R" => "SSE2170", "SVIK - Studsvik" => "SSE13094", "SHB A - Sv. Handelsbanken A" => "SSE340", "SHB B - Sv. Handelsbanken B" => "SSE341", "SWEC A - SWECO A" => "SSE1061", "SWEC B - SWECO B" => "SSE1062", "SWED A - Swedbank A" => "SSE120", "SWED PREF - Swedbank pref" => "SSE61365", "SVED B - Svedbergs B" => "SSE935", "SWMA - Swedish Match" => "SSE361", "SOBI - Swedish Orphan Biovitrum" => "SSE36316", "SWOL B - Swedol B" => "SSE55913", "SVOL A - Svolder A" => "SSE936", "SVOL B - Svolder B" => "SSE937", "SYSR - Systemair" => "SSE43007", "TEL2 A - Tele2 A" => "SSE1026", "TEL2 B - Tele2 B" => "SSE1027", "TLSN - TeliaSonera" => "SSE5095", "TIEN - Tieto Oyj" => "SSE4025", "TRAC B - Traction B" => "SSE4963", "TRAD - TradeDoubler" => "SSE31884", "TWW SDB A - Transcom WorldWide SDB A" => "SSE14353", "TWW SDB B - Transcom WorldWide SDB B" => "SSE14354", "TRMO - Transmode Holding" => "SSE82457", "TREL B - Trelleborg B" => "SSE364", "TAGR - Trigon Agri" => "SSE40543", "UNIB SDB - Unibet Group" => "SSE36950", "UFLX B - Uniflex B" => "SSE36986", "WALL B - Wallenstam B" => "SSE945", "VBG B - VBG GROUP B" => "SSE942", "VRG B - Venue Retail Group B" => "SSE946", "WIHL - Wihlborgs Fastigheter" => "SSE29759", "VIT B - Vitec Software Group B" => "SSE5177", "VITR - Vitrolife" => "SSE13469", "VOLV A - Volvo A" => "SSE365", "VOLV B - Volvo B" => "SSE366", "VNIL SDB - Vostok Nafta Investment, SDB" => "SSE41044", "XANO B - XANO Industri B" => "SSE1074", "AF B - ÅF B" => "SSE862", "ORES - Öresund" => "SSE863");
//exit(0);
$sourcescraper = 'aktietips';
scraperwiki::attach($sourcescraper);
$data = scraperwiki::select("stock, by, `to`, date, rec\nfrom `swdata` \nwhere date > '2011-01-01' and date < '2012-05-01' and stock = 'Volvo'\norder by date asc");
$search_maklare = array();
for ($i = 0; $i < count($data); $i++) {
$maklare = $data[$i]["by"];
if (array_key_exists($maklare, $search_maklare) || $maklare == null || $maklare == "") {
continue;
}
$stock = $data[$i]["stock"];
$mrows = getReksFromMaklare($stock, $maklare, $data);
print_r("<b>" . $stock . " av " . $maklare . "</b><br />");
$search_maklare[$maklare] = true;
$kurs1 = -1;
$rek1 = null;
$points = 0;
foreach ($mrows as $row) {
print_r($row["by"] . " (" . $row["date"] . "), rek: " . $row["rec"] . ", riktkurs: " . $row["to"] . "<br />");
示例13:
<ev:enddate><?php
echo $enddate;
?>
</ev:enddate>
<ev:location>Lichfield Cathedral</ev:location>
<georss:point>52.685556 -1.830556</georss:point>
</item>
<?php
}
?>
</rdf:RDF><?php
// Attach the data
scraperwiki::attach("hhhlich-lichfield-arts-events");
// Get the data
$data = scraperwiki::select("* from swdata limit 10");
//print_r($data);
echo '<?xml version="1.0" encoding="utf-8"?>';
?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ev="http://purl.org/rss/1.0/modules/event/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:georss="http://www.georss.org/georss"
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
xmlns="http://purl.org/rss/1.0/">
<rdf:Description rdf:about="http://lichfieldlive.co.uk/">
<dc:title>Lichfield What's On Importer</dc:title>
<dc:source rdf:resource="http://www.lichfield-cathedral.org/"/>
<dc:creator>Lichfield Community Media</dc:creator>
示例14: fourOhFour
}
}
return null;
}
# Check for pages with no usable data
function fourOhFour($html)
{
if (strpos($html, 'Home not available', 1200) !== false) {
return true;
}
return false;
}
$blacklist = array();
# get an array of the cottage data to scrape
scraperwiki::attach("bluechip_summary");
$cottData = scraperwiki::select(" COTTAGE_ID, COTTAGE_URL, SLEEPS, BEDROOMS, FEATURES,COTTAGE_NAME, PRICE_LOW from 'bluechip_summary'.SWDATA order by COTTAGE_URL");
$placeholder = scraperwiki::get_var("cottURL");
if ($placeholder != "") {
$index = searchForId($placeholder, $cottData);
$cottData = array_splice($cottData, $index);
}
require 'scraperwiki/simple_html_dom.php';
$dom = new simple_html_dom();
foreach ($cottData as $value) {
$highPrice = "";
$lowPrice = "";
$found = 0;
$count = 0;
scraperwiki::save_var("cottURL", $value['COTTAGE_URL']);
// check the cottage url against the blacklist
foreach ($blacklist as $blItem) {
示例15: foreach
)</li>
<?php
$orgs[$organization] += 1;
}
print "</ul>";
print "<h2>Organizations contacted</h2><ul>";
foreach ($orgs as $o => $k) {
?>
<li><?php
echo $o;
?>
(<?php
echo $k;
?>
)</li><?php
}
print '</ul>';
$data = scraperwiki::select("count(*) AS c, subject AS s FROM contact INNER JOIN contact_subject ON contact_subject.contact_id=contact.contact_id WHERE behalf='{$w}' GROUP BY subject ORDER BY subject DESC");
print "<h2>Subjects covered</h2><ul>";
foreach ($data as $row) {
extract($row);
?>
<li><?php
echo $s;
?>
(<?php
echo $c;
?>
)</li><?php
}
print "</ul>";