aboutsummaryrefslogtreecommitdiffstats
path: root/meetup
AgeCommit message (Collapse)Author
2018-04-15Change import interface to `meetup::client::Client`Teddy Wing
Instead of doing `use meetup::client::Client`, do `use meetup::Client`. Makes it less redundant.
2018-04-15meetup_rss: Add `description_header` to format date & venueTeddy Wing
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.
2018-04-15Add `Venue` type and venue field to `Event`Teddy Wing
This allows us to deserialise the venue location for events and include it in the RSS items.
2018-04-15Update tests for `Event` `Option` fieldsTeddy Wing
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.
2018-04-15Event: Make `description`, `local_date`, `local_time` optionalTeddy Wing
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.
2018-04-15Add 'error-chain' to the main libraryTeddy Wing
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.
2018-04-15meetup: Handle errors with 'error-chain'Teddy Wing
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.
2018-04-14meetup: Add 'error-chain' crateTeddy Wing
2018-04-14find_upcoming_events(): Try to parse data from the Meetup APITeddy Wing
* 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.
2018-04-14Pass `find_upcoming_events` parameters along through the programTeddy Wing
2018-04-14Move `find_upcoming_events` and `parse_json` to `Client`Teddy Wing
We'll call `find_upcoming_events` on `Client` to give us access to the token it holds.
2018-04-14meetup: Add a `Client` structTeddy Wing
This will hold our API token and provide methods to make API requests.
2018-04-14meetup(find_upcoming_events): Draft of request to Meetup APITeddy Wing
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`.
2018-04-13meetup: Add 'reqwest' crateTeddy Wing
2018-04-13meetup(find_upcoming_events): Make this function actually do somethingTeddy Wing
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.
2018-04-13Add a function to build an RSS `Channel` object from a list of `Event`sTeddy Wing
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.
2018-04-13meetup(parse_json): Align test and test dataTeddy Wing
* 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.
2018-04-13meetup(parse_json): Return a Vec of EventsTeddy Wing
* 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
2018-04-13meetup: Add 'serde' and 'serde_derive' cratesTeddy Wing
So we can derive `Deserialize` on our `Event` type.
2018-04-13meetup--find-upcoming_events.json: Escape double quotesTeddy Wing
A bunch of the descriptions had double quotes in them (`"`) that weren't escaped. Escape these to make the JSON valid.
2018-04-13Ideas for functions to extract `Event`s from JSONTeddy Wing
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`.
2018-04-12meetup: Create `Event` structTeddy Wing
Include some fields that seem interesting. Also leave a note that we'll want to create a new struct for `Venue` because this is a sub hash in the JSON response.
2018-04-12meetup: Add 'serde_json' crateTeddy Wing
For deserialising JSON from the API to a struct.
2018-04-12Add some test JSON from the Meetup APITeddy Wing
This comes from: https://api.meetup.com/find/upcoming_events?&sign=true&photo-host=public&page=20 Grabbed from the browser API console. We'll use this for writing unit tests.
2018-04-12Add a "meetup" library crate to communicate with the Meetup APITeddy Wing