**PRE-ALPHA: Only works with Idox and Northgate sites and spews a lot of stuff to STDOUT. Not for production use.**
**PRE-ALPHA: Only works with Idox and Northgate sites and spews a lot of stuff
to STDOUT. Not for production use.**
This gem scrapes planning applications data from UK local planning authority websites, eg Westminster City Council. Data is returned as an array of hashes, one hash for each planning application.
This gem scrapes planning applications data from UK local planning authority
websites, eg Westminster City Council. Data is returned as an array of hashes,
one hash for each planning application.
This scraper gem doesn't use a database. Storing the output is up to you. It's just a convenient way to get the data.
This scraper gem doesn't use a database. Storing the output is up to you. It's
just a convenient way to get the data.
Currently this only works for Idox and Northgate sites. The ultimate aim is to provide a consistent interface in a single gem for all variants of all planning systems: Idox Public Access, Northgate Planning Explorer, OcellaWeb, Agile Planning and all the one-off systems.
Currently this only works for Idox and Northgate sites. The ultimate aim is to
provide a consistent interface in a single gem for all variants of all planning
systems: Idox Public Access, Northgate Planning Explorer, OcellaWeb, Agile
Planning and all the one-off systems.
This project is not affiliated with any organisation.
This project is not affiliated with any organisation.
@@ -15,7 +22,8 @@ This project is not affiliated with any organisation.
pp apps # You'll probably want to save `apps` to your database here
authorities.each do |authority|
applications = authority.decided_days(7).scrape
pp applications
# You'll probably want to save `applications` to your database here
end
end
```
```
Yes, we just scraped the last week's planning decisions across the whole of London (actually 23 of the 35 authorities right now) with five lines of code.
### Satisfy your niche interests
### Satisfy your niche interests
Launderette applications validated in the last seven days in Scotland:
This gem has no interest whatsoever in persistence. What you do with the data it outputs is up to you: relational databases, document stores, VHS and clay tablets are all blissfully none of its business. But using the [ScraperWiki](https://github.com/openaustralia/scraperwiki-ruby) gem is a really easy way to store your data:
This gem has no interest whatsoever in persistence. What you do with the data it
outputs is up to you: relational databases, document stores, VHS and clay
tablets are all blissfully none of its business. But using the
[ScraperWiki](https://github.com/openaustralia/scraperwiki-ruby) gem is a really
easy way to store your data:
```ruby
```ruby
require 'scraperwiki' # Must be installed, of course
require 'scraperwiki' # Must be installed, of course
That `apps` param can be a hash or an array of hashes, which is what gets returned by our `Authority.scrape`.
That `applications` param can be a hash or an array of hashes, which is what
gets returned by our `Authority.scrape`.
### Find authorities by tag
### Find authorities by tag
@@ -130,11 +159,18 @@ and whatever you'd like to add that would be useful to others.
### WTF is up with London?
### WTF is up with London?
London has got 32 London Boroughs, tagged `londonboroughs`. These are the councils under the authority of the Mayor of London and the Greater London Authority.
London has got 32 London Boroughs, tagged `londonboroughs`. These are the
councils under the authority of the Mayor of London and the Greater London
Authority.
It has 33 councils: the London Boroughs plus the City of London (named `City of London`). We don't currently have a tag for this, but if you want to add `londoncouncils` please go ahead.
It has 33 councils: the London Boroughs plus the City of London (named `City of
London`). We don't currently have a tag for this, but if you want to add
`londoncouncils` please go ahead.
And it's got 35 local planning authorities: the 33 councils plus the two `londondevelopmentcorporations`, named `London Legacy Development Corporation` and `Old Oak and Park Royal Development Corporation`. The tag `london` covers all (and only) the 35 local planning authorities in London.
And it's got 35 local planning authorities: the 33 councils plus the two
`londondevelopmentcorporations`, named `London Legacy Development Corporation`
and `Old Oak and Park Royal Development Corporation`. The tag `london` covers
all (and only) the 35 local planning authorities in London.
The easiest way to add to or edit this list is to edit within GitHub (use the pencil icon) and create a new pull request for your changes. If accepted, your changes will be available to everyone with the next version of the gem.
The easiest way to add to or edit this list is to edit within GitHub (use the
pencil icon) and create a new pull request for your changes. If accepted, your
changes will be available to everyone with the next version of the gem.
The file format is one line per authority, with comma-separated:
The file format is one line per authority, with comma-separated:
- Name (omit "the", "council", "borough of", "city of", etc. and write "and" not "&", except for `City of London` which is a special case)
- Name (omit "the", "council", "borough of", "city of", etc. and write "and" not
"&", except for `City of London` which is a special case)
- URL of the search form (use the advanced search URL if there is one)
- URL of the search form (use the advanced search URL if there is one)
- Tags (use as many comma-separated tags as is reasonable, lowercase and all one word.)
- Tags (use as many comma-separated tags as is reasonable, lowercase and all one
word.)
There's no need to manually add tags to the `authorities.csv` file for the software systems like `idox`, `northgate` etc as these are added automatically.
There's no need to manually add tags to the `authorities.csv` file for the
software systems like `idox`, `northgate` etc as these are added automatically.
Please check the tag list before you change anything:
Please check the tag list before you change anything:
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
After checking out the repo, run `bin/setup` to install dependencies. You can
also run `bin/console` for an interactive prompt that will allow you to
experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
To install this gem onto your local machine, run `bundle exec rake install`. To
release a new version, update the version number in `version.rb`, and then run
`bundle exec rake release`, which will create a git tag for the version, push
git commits and tags, and push the `.gem` file to
[rubygems.org](https://rubygems.org).
## Contributing
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/adrianshort/uk_planning_scraper.
Bug reports and pull requests are welcome on GitHub at