Skip to content

Instantly share code, notes, and snippets.

@crynobone
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crynobone/76e42d27c7c11d1f29cb to your computer and use it in GitHub Desktop.
Save crynobone/76e42d27c7c11d1f29cb to your computer and use it in GitHub Desktop.
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