diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..66d464d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ignore output of scraper +data.sqlite diff --git a/README.md b/README.md new file mode 100644 index 0000000..e541894 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +This is a scraper that runs on [Morph](https://morph.io). To get started [see the documentation](https://morph.io/documentation) \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..5a40d51 --- /dev/null +++ b/composer.json @@ -0,0 +1,15 @@ +{ + "repositories": [ + { + "url": "https://github.com/openaustralia/scraperwiki-php.git", + "type": "git" + } + ], + "require": { + "openaustralia/scraperwiki": "dev-morph_defaults", + "ext-sqlite3": "*", + "ext-pdo_sqlite": "*", + "ext-gd": "*", + "ext-mbstring": "*" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..595e9ed --- /dev/null +++ b/composer.lock @@ -0,0 +1,39 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "6a183e962cc8b0a2078d3ea1323e8f64", + "packages": [ + { + "name": "openaustralia/scraperwiki", + "version": "dev-morph_defaults", + "source": { + "type": "git", + "url": "https://github.com/openaustralia/scraperwiki-php.git", + "reference": "e996fe0253bb50330690f5d2bafb66f094dbacb8" + }, + "require": { + "ext-pdo_sqlite": "*" + }, + "type": "library", + "time": "2014-06-23 01:47:45" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "openaustralia/scraperwiki": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "ext-sqlite3": "*", + "ext-pdo_sqlite": "*", + "ext-gd": "*", + "ext-mbstring": "*" + }, + "platform-dev": [] +} diff --git a/scraper.php b/scraper.php new file mode 100644 index 0000000..87fec18 --- /dev/null +++ b/scraper.php @@ -0,0 +1,27 @@ +load($html); +// print_r($dom->find("table.list")); +// +// // Write out to the sqlite database using scraperwiki library +// scraperwiki::save_sqlite(array('name'), array('name' => 'susan', 'occupation' => 'software developer')); +// +// // An arbitrary query against the database +// scraperwiki::select("* from data where 'name'='peter'") + +// You don't have to do things with the ScraperWiki library. +// You can use whatever libraries you want: https://morph.io/documentation/php +// All that matters is that your final data is written to an SQLite database +// called "data.sqlite" in the current working directory which has at least a table +// called "data". +?>