-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetadata_fetcher.php
33 lines (21 loc) · 1.08 KB
/
metadata_fetcher.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
<?php
// ReadPoppel - Meta Data Fetcher
// Started writing 24 january 2016
// (c) Juho Sulka 2015 - 2016
// get configuration file from main dir
include("configuration.php");
error_reporting(0);
$paperName = "iltasanomat";
$xml = simplexml_load_file("http://www.e-pages.dk/" . $paperName . "/100/calendar/demo");
$papCCnt = $xml->meta->catalogs;
//$papCnt = $dataconnection->query("SELECT paperID FROM papers WHERE paperBrand = 'pohjalainen'");
foreach($xml->catalogs->catalog as $paper)
{
// load xml with simplexml_load_file
$xml = simplexml_load_file("http://localhost/testprox.php?paperbrand=" . $paperName . "&paperId=" . $paper["id"]);
foreach($xml->articles->article as $meta)
{
$dataconnection->query("INSERT INTO `papers_metadatas` (`paperBrand`, `paperId`, `additionalImageURL`, `page_number`, `phrase_title`, `phrase_text`) VALUES ('" . $paperName . "', '" . $paper["id"] . "', '" . $meta->images->image->medium . "', '" . $meta->page . "' , '" . utf8_decode($meta->titles->title) . "', '" . strip_tags(utf8_decode($meta->content)) . "')");
}
}
?>