summaryrefslogtreecommitdiffstats
path: root/public/postload.php
blob: 69d6571d876c2bf6df253470e4cf3c25e405b99f (plain)
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
<?php

require_once '../app/app.php';

if (!$PlanetConfig::isInstalled()) {
    die();
}

$xml = new SimpleXMLElement(file_get_contents($PlanetConfig->getOpmlFile()));

foreach ($xml->xpath('/opml/body/outline[@xmlUrl]') as $element) {
    if ($element->attributes()->xmlUrl == $_GET['url']) {
        $person = new PlanetFeed(
            '',
            $_GET['url'],
            '',
            false
        );
        $Planet->addPerson($person);

        $Planet->download(1);
        header('Content-type: image/png');
        readfile(__DIR__ . '/custom/img/feed.png');
        die();
    }
}

echo 'Updating this URL is not allowed.';