Exemplo n.º 1
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require "AlboComuneCTParser.php";
//backward compatibility
if (isset($_GET['repertorio'])) {
    $repertorioPieces = explode('/', $_GET['repertorio']);
    $anno = trim($repertorioPieces[0]);
    $numero = trim($repertorioPieces[1]);
} else {
    $anno = $_GET['anno'];
    $numero = $_GET['numero'];
}
if (!isset($anno) || !isset($numero)) {
    die("E' necessario specificare anno e numero di repertorio.");
}
$entry = AlboComuneCTParser::createByRepertorio($anno, $numero)->current();
if ($entry == null) {
    die("Nessun elemento col numero di repertorio {$anno} \\ {$numero}");
}
$title = "Albo POP Comune di Catania - Avviso {$repertorio}";
$logo = "ct-logo-pop.jpg";
$description = $entry->repertorio . " - " . $entry->tipo . ": " . $entry->mittente_descrizione;
$link = $entry->link;
$css = "../RSS/sharer.css";
$news = null;
$credits = "Il logo di questo albo pop &egrave; stato ottenuto dalla \n\t\t\tpagina di Wikipedia che riporta lo <a href=\"https://it.wikipedia.org/wiki/File:Catania-Stemma.png\">stemma del comune di Catania</a>,\n\t\t\telaborandolo poi con il tool <a href=\"https://photofunia.com/effects/popart\">PhotoFunia</a>.";
require "../RSS/sharer-template.php";
Exemplo n.º 2
0
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require "AlboComuneCTParser.php";
require "../RSS/RSSFeedGenerator.php";
require "../RSS/RSSFeedItem.php";
require "../phpalbogenerator/AccessLogUtils.php";
define("RSSPATH", "http://dev.opendatasicilia.it/albopop/catania/");
AccessLogUtils::logAccess();
$parser = AlboComuneCTParser::createByYear();
$feed = new RSSFeedGenerator("Albo del Comune di Catania", "Versione POP e social dell'Albo Pretorio del Comune di Catania", "http://www.comune.catania.gov.it/EtnaInWeb/AlboPretorio.nsf/HomePage?Open&buffer=A20110301121017437GH", RSSPATH . "alboct2RSS-social.php");
foreach ($parser as $r) {
    //remove the sender if it is internal to the municipality of Catania
    $title = preg_replace('%^.*- COMUNE DI CATANIA *%', '', $r->mittente_descrizione, 1);
    if (empty($title)) {
        $feed->addItem('ERROR', null, null, $r->link, $r->link);
    } else {
        $description = $r->repertorio . " - " . $r->tipo . ": " . $r->mittente_descrizione;
        $newpagelink = RSSPATH . 'sharer.php?anno=' . urlencode($r->anno) . "&numero=" . urlencode($r->numero);
        $feed->addItem($title, $description, null, $newpagelink, $newpagelink);
    }
}
//output
header('Content-type: application/rss+xml; charset=UTF-8');
/*