aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2018-04-15Add license (GNU GPLv3+)Teddy Wing
2018-04-15build_rss(write_feed): Set time to a second before midnightTeddy Wing
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.
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-15Pass `latitude`, `longitude`, `end_date` to `build_rss::write_feed`Teddy Wing
Make these values user-modifiable finally.
2018-04-15Always print help message if `-h` or `--help` flags passedTeddy Wing
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.
2018-04-15Add `latitude`, `longitude`, `end-date` command line argumentsTeddy Wing
These will be passed to `build_rss::write_feed`.
2018-04-15meetup_rss: Use HTML formatting for descriptionTeddy Wing
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.
2018-04-15meetup_rss(generate): Don't include newlines in description if emptyTeddy Wing
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.
2018-04-15meetup_rss: Create `join_nonempty` functionTeddy Wing
Move the join logic from `description_header` into a new function so we can reuse it.
2018-04-15meetup_rss(description_header): Improve string join sectionTeddy Wing
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") | ^^^^
2018-04-15meetup_rss(generate): Include `description_header` in item descriptionTeddy Wing
2018-04-15meetup_rss(description_header): Delete dev commentsTeddy Wing
These were in-progress development ideas that have been superseded.
2018-04-15meetup_rss(description_header): Add header commentTeddy Wing
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-15build_rss(write_feed): Automatically handle date formattingTeddy Wing
* 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.
2018-04-15generate(): Add a real title and description to the feed channelTeddy Wing
The description isn't very descriptive, but I'm a little tired right now.
2018-04-15Use the correct time format for `end_date_range`Teddy Wing
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.
2018-04-15Use 'error-chain' in `main()`Teddy Wing
Display all our errors this way.
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-14Pass `find_upcoming_events` parameters along through the programTeddy Wing
2018-04-13meetup_rss(write): Use the result from `Channel#write_to`Teddy Wing
I didn't pay attention when I wrote this, but that method actually returns a `Result`, so we need to use it.
2018-04-13meetup_rss(write): Remove `mut` from the `stdout` handleTeddy Wing
I had copied this from an example in the docs, but the compiler tells me the `mut` isn't needed. Cool.
2018-04-13Output a feed to STDOUT when running the executableTeddy Wing
* 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.
2018-04-13meetup_rss: Add a `write` function to write a channel to STDOUTTeddy Wing
2018-04-13meetup(generate): Improve test and take a reference argumentTeddy Wing
* 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.
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-12Make `meetup-api-token` a required argument, print its valueTeddy Wing
Use `reqopt` since this is a required option. Since the `opts.parse` call will catch it if it isn't present earlier in the `main` function, just unwrap it when extracting it.
2018-04-12Print Getopts errors with a newlineTeddy Wing
2018-04-12Parse command line arguments and add help outputTeddy Wing
Include an option to pass a Meetup.com API token (not saved yet).
2018-04-12Initial commit. Generated Rust v1.25.0 project.Teddy Wing
Generated with: $ cargo new --bin meetup-find-events-rss