Age | Commit message (Collapse) | Author |
|
|
|
Otherwise Newsboat errors when trying to access the feed.
|
|
|
|
Start tracking my personal TODO file.
|
|
|
|
|
|
This was a reference for the params I wanted to support in the
`find_upcoming_events()` method. It's no longer needed.
|
|
Previously we used midnight, but this meant that the entire day
specified by `end_date` would be excluded, which is counterintuitive.
Instead use a second before midnight to include the rest of that day.
|
|
Instead of doing `use meetup::client::Client`, do `use meetup::Client`.
Makes it less redundant.
|
|
Make these values user-modifiable finally.
|
|
Since we've set up required arguments, 'getopts' fails fast and
complains about missing required args even if the only one used was `-h`
or `--help`. Why should you care about required arguments? You wanted
help in the first place, how are you going to know?
Thankfully, this message from 'prasannavl' pointed me in the right
direction:
https://github.com/rust-lang-nursery/getopts/issues/46#issuecomment-343842947
If there's an option parse failure, we can just look for the help flags
in the args vec to see if we should display the help.
|
|
These will be passed to `build_rss::write_feed`.
|
|
Well, turns out that the RSS item `description` field uses HTML, so my
`\n`s didn't actually change the formatting in a real RSS reader. Use
HTML tag formatting instead to get our description header with date and
venue to look right.
|
|
If either the description or both the date & time and venue were empty,
a couple of newlines would unnecessarily be added to the `Item`
description. This gets rid of them.
|
|
Move the join logic from `description_header` into a new function so we
can reuse it.
|
|
Instead of the verbose and unclear appending, use a `join` to add the
newline. Filter out empty strings to ensure the newline doesn't get
added if any of `where` or `place` are empty.
Needed to convert the slice strings to owned strings to deal with this
error:
error[E0599]: no method named `join` found for type `std::vec::Vec<&std::string::String>` in the current scope
--> src/meetup_rss.rs:92:10
|
92 | .join("\n")
| ^^^^
|
|
|
|
These were in-progress development ideas that have been superseded.
|
|
|
|
This function will format a string containing a date and venue for
inclusion in the description of an RSS `Item`.
Added a `derive(Clone)` on `Venue` in order to be able to clone it to
use its fields in the function.
|
|
This allows us to deserialise the venue location for events and include
it in the RSS items.
|
|
Now that the `description`, `local_date`, and `local_time` fields are
`Option` types, we need to update the tests to reflect this or they fail
terribly.
I made the change in aa0190279db75f75210f5279afaa62178b242837 but forgot
to update the tests.
|
|
* Take a date formatted in `%Y-%m-%d` and append the extra `THH:MM:SS`
that the Meetup API requires. We'll just be taking a regular string
from a user-inputted command line argument instead of a real date type
because it's easier and simpler.
* Use the name `end_date` to distinguish it from the `end_date_range`
parameter used by the API.
|
|
The description isn't very descriptive, but I'm a little tired right
now.
|
|
After making a request to the API and getting a real JSON response
again, it turns out that the above mentioned fields are actually
optional, and will break Serde's parsing when they're not in the JSON
string coming from Meetup. Make these fields `Option`s so the program
doesn't break when they're not there.
|
|
The Meetup API requires the `end_date_range` param to use this format,
otherwise it responds with an error.
Eventually we'll want to make this an actual time type and then
`strftime` it to this string.
|
|
Display all our errors this way.
|
|
Use 'error-chain' here too. Seems like this will be a pretty useful
library.
Change the include in the 'meetup' `lib.rs` to allow us to export
`meetup::Error` instead of `meetup::errors::Error` to be consistent with
the error types of the other third-party libraries we're using.
|
|
Use this instead of `Box`es. Hoping this, along with using the library
in my main crate also, will help me get some more context on my runtime
error.
Hey, it did! Turns out the error is coming from 'serde_json'. Cool.
|
|
|
|
|
|
* Clone the token so we can use it without a borrow error
* Get the response text from our request to the API and try to parse it
This gives me the following panic:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err`
value: ErrorImpl { code: Message("invalid type: null, expected a
sequence"), line: 0, column: 0 }', libcore/result.rs:945:5
Still trying to figure out where my problem is.
|
|
|
|
We'll call `find_upcoming_events` on `Client` to give us access to the
token it holds.
|
|
This will hold our API token and provide methods to make API requests.
|
|
Set up the code to make a request to the Meetup API. Still needs an API
key, and we need to call the function correctly in `write_feed`.
|
|
I didn't pay attention when I wrote this, but that method actually
returns a `Result`, so we need to use it.
|
|
I had copied this from an example in the docs, but the compiler tells me
the `mut` isn't needed. Cool.
|
|
|
|
* Add a new module that contains a "main" library function that does the
integration for generating the feed and outputting it to STDOUT.
* Call this function from `main()` and have it output a real feed.
|
|
Eventually, I want this function to make a request to the Meetup API and
return a `Vec` of `Event`s.
For now, though, so we can test things out, use our test JSON file
instead of a real web request.
|
|
|
|
* Take a `Vec` reference instead of an object. This is the result of
messing around with calling the function in the test.
* Update the test to actually make assertions on the result of the
function.
|
|
This uses the RSS crate to build a new channel with items corresponding
to the given `Event`s. It needs to be fleshed out a little, but this is
the basic idea.
|
|
|
|
* Add an additional `Event` to the list of expected events to give us
more than one to test with.
* Remove all but the first two events from the JSON test data so we
don't have to reproduce all of those events in our test code.
|
|
* Derive `Deserialize` on our `Event` type
* Use Serde to parse a `Vec` of `Event`s that we can return from the
function
* Return a `Result` from the function to handle Serde errors
|
|
So we can derive `Deserialize` on our `Event` type.
|
|
A bunch of the descriptions had double quotes in them (`"`) that weren't
escaped. Escape these to make the JSON valid.
|
|
Add a couple function skeletons. Write the beginning of a test for the
function that parses a JSON string to a list of `Event`s.
In order to do the test, needed to derive `Debug` and `PartialEq` on
`Event`.
|