Skip to content

Instantly share code, notes, and snippets.

@crynobone
Last active Aug 29, 2015
Embed
What would you like to do?
Parsing Malaysia Public Holiday.
{
"authors": [
{
"name": "crynobone",
"email": "crynobone@gmail.com"
}
],
"require": {
"orchestra/parser": "~3.0"
},
"require-dev": {
"symfony/var-dumper": "~2.6"
},
"license": "MIT",
"minimum-stability": "dev"
}
<?php
include "vendor/autoload.php";
$url = "https://www.google.com/calendar/feeds/en.malaysia%23holiday@group.v.calendar.google.com/public/basic";
$app = new Illuminate\Container\Container;
$document = new Orchestra\Parser\Xml\Document($app);
$reader = new Orchestra\Parser\Xml\Reader($document);
$xml = $reader->extract(file_get_contents($url));
dd($xml->parse(['entry' => ['uses' => 'entry[id,title,content,published,updated]']]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment