<commit_before># NationalRail
## Installation

Use in a Bundler app. Add to bundler:
    gem "national_rail"

## Example Usage
The gem is extremely simple to use. There are two class methods that return the next departures or arrivals from a station.

    NationalRail::Timetable.departures(token, "BHM")
    # => [{"origin":"Longbridge","origin_crs":"LOB","destination":"Four Oaks","destination_crs":"FOK","time":"14:45"},{"origin":"Wolverhampton","origin_crs":"WVH","destination":"Walsall","destination_crs":"WSL","time":"14:47"},...]

    NationalRail::Timetable.arrivals(token, "BHM")
    # => [{"origin":"Longbridge","origin_crs":"LOB","destination":"Four Oaks","destination_crs":"FOK","time":"14:42"},{"origin":"Wolverhampton","origin_crs":"WVH","destination":"Walsall","destination_crs":"WSL","time":"14:44"},...]            
            

## Wrap it in Sinatra
I've used this in a simple Sinatra app. It's easy:

    require 'sinatra'
    require 'national_rail'
    require 'json'

    get '/departures/:crs' do
      NationalRail::Timetable.departures('...', params[:crs]).to_json
    end
    get '/arrivals/:crs' do
      NationalRail::Timetable.arrivals('...', params[:crs]).to_json
    end
            
## Contributing<commit_msg>Use ruby in MD in readme.<commit_after># NationalRail
## Installation

Use in a Bundler app. Add to bundler:
    gem "national_rail"

## Example Usage
The gem is extremely simple to use. There are two class methods that return the next departures or arrivals from a station.

```ruby
NationalRail::Timetable.departures(token, "BHM")
# => [{"origin":"Longbridge","origin_crs":"LOB","destination":"Four Oaks","destination_crs":"FOK","time":"14:45"},{"origin":"Wolverhampton","origin_crs":"WVH","destination":"Walsall","destination_crs":"WSL","time":"14:47"},...]

NationalRail::Timetable.arrivals(token, "BHM")
# => [{"origin":"Longbridge","origin_crs":"LOB","destination":"Four Oaks","destination_crs":"FOK","time":"14:42"},{"origin":"Wolverhampton","origin_crs":"WVH","destination":"Walsall","destination_crs":"WSL","time":"14:44"},...]            
```     

## Wrap it in Sinatra
I've used this in a simple Sinatra app. It's easy:

```ruby
require 'sinatra'
require 'national_rail'
require 'json'

get '/departures/:crs' do
  NationalRail::Timetable.departures('...', params[:crs]).to_json
end
get '/arrivals/:crs' do
  NationalRail::Timetable.arrivals('...', params[:crs]).to_json
end
```
            
## Contributing
{'fraction_non_alphanumeric': 0.19374492282696995, 'fraction_numerical': 0.012997562956945572, 'mean_word_length': 5.430809399477806, 'pattern_counts': {'":': 40, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3646110', 'n_tokens_mistral': 856, 'n_tokens_neox': 790, 'n_words': 162}