Permalink
Switch branches/tags
Nothing to show
Commits on May 23, 2018
  1. Don't wrap plain text versions of screams

    gfontenot committed May 23, 2018
    Previously, pandoc would add newlines to our plain text versions of screams.
    This made screams look _really_ bad when cross-posted to services like
    Twitter.
    
    To solve this, we can specify WrapNone as our wrapping option inside our plain
    text options.
    
    We'll also go ahead and add some tests around this function to make sure it's
    behaving like we expect.
    
    Fixes #50
  2. Delete HomeSpec

    gfontenot committed May 23, 2018
    This was failing and also we didn't need it
Commits on Dec 31, 2017
  1. Remove unused lucius file

    gfontenot committed Dec 31, 2017
    This was from the original template.
  2. Add the ability to edit screams

    gfontenot committed Dec 31, 2017
    This adds a new Edit route that lets me edit an individual scream. This change
    meant needing to generalize some of the rendering/form functions and
    templates.
  3. Consolidate Scream handlers

    gfontenot committed Dec 31, 2017
    Instead of managing individual handlers for each action we could take with a
    scream, it probably makes more sense to consolidate everything in a single
    handler. This will help code reuse moving forward.
Commits on Aug 8, 2017
  1. Don't escape encoded markup

    gfontenot committed Aug 8, 2017
    Yesod defaults to escaping markup when using interpolation in Hamlet. This is
    a good default, but we've actually already converted our html content to
    rendered html, so escaping it here is counter productive.
    
    To solve this, we can convert from `Text` to `Html` explicitly ourselves by
    specifying that the content is already pre-escaped.
    
    This will fix the html rendering in our RSS feeds.
Commits on Jun 28, 2017
  1. Remove yesod-markdown dependency

    gfontenot committed Jun 28, 2017
    We were already duplicating a good chunk of the yesod-markdown lib
    because we wanted to customize our reading options. As it turns out,
    with a bit more code we can remove the dependency on the lib entirely,
    which will have the added benefit of removing a bit more implicit
    behavior, and expose our preferences directly.
    
    While we're in here, I'm going to go ahead and reorganize things and
    explicitly declare our imports/exports. This will make refactoring
    easier in the future.
Commits on Jun 27, 2017
  1. Use Pandoc for generating plain text screams

    gfontenot committed Jun 27, 2017
    Previously, we were using hxt for generating the plain text versions of
    our screams. This meant going from Markdown (Text) to Pandoc to Html to
    Text. On top of being fairly inefficient, it also meant that during the
    round trip we lost any newline characters that we had added to the text.
    
    To simplify (and improve) things, we can instead use Pandoc directly to
    print to plain text. This is possible out of the box by using
    `writePlain` and a very simple set of writer options. However, this does
    have one unexpected side effect of not stripping inline styles (even
    though the docs say that it does). This means that `_Hello_ __world__`
    would render as `_Hello_ WORLD`. I'd rather it just strip these out
    entirely, so I'm adding a simple filter into the mix that strips these
    elements from the document before writing.
    
    I'm also taking the opportunity to rename this to `plainText` which I
    like a bit more.
  2. Use Twitter's algorithm for character counts

    gfontenot committed Jun 27, 2017
    Twitter does some special things like URL shortening with a constant
    character count (23). This means that just counting the number of
    characters in our rendered markdown could have _wildly_ different
    character counts. We could either be showing a count that is way over if
    we submit a super long URL, or way under if we have a short url.
    
    To fix this, we can use the handy twitter-text javascript library, which
    Twitter provides to do this exact kind of thing:
    
    https://github.com/twitter/twitter-text/tree/master/js
    
    With this lib in place, we just need to call the new specialized count
    function and we'll end up with an accurate character count.
Commits on Jun 2, 2017
  1. Redirect old feed url to new one

    gfontenot committed Jun 2, 2017
    We already shipped with support for hitting the feed at /feed.xml. To
    support any clients that might still be hitting this url, we should add
    a simple redirect to the new endpoint.
  2. Remove rssTimestamp

    gfontenot committed Jun 2, 2017
    We don't need this anymore, since we're just using the RFC 3339 format
    for feeds.
  3. Simplify content generation

    gfontenot committed Jun 2, 2017
    We don't need an extra function for this. Instead, it's just as
    straightforward to inline it.
  4. Ensure that we're using FeedItems inside template

    gfontenot committed Jun 2, 2017
    During refactoring, we accidentally left this template as referencing
    'items' instead of pointing it at the feed's items. This meant that we
    didn't have access to stuff we had already calculated, like the html
    content and the timestamp.
    
    To fix this, we can update our template to refer to the feed items
    coming from the feed, and then we can ensure that this reference isn't
    even available by one-lining our feed generation function.
  5. Expose FeedItemAuthor

    gfontenot committed Jun 2, 2017
  6. Rename feed templates to be more descriptive

    gfontenot committed Jun 2, 2017
    This basically moves our wrapper and items templates into an xml
    subdirectory of our feed templates, but it also renames the html content
    template so that it's a bit more descriptive.
  7. Consolidate feeds into single endpoint

    gfontenot committed Jun 2, 2017
    We can actually use Yesod to serve up multiple representations of the
    same content, based on the requested content type (via the Accept
    header). This is a neat feature that we should definitely use.
    
    To do this, we're going to restructure our feed construction into a more
    data-centric approach, which I actually like better anyway. We'll have
    some new data types and then we can implement `ToJSON` instances for
    those types, which will automatically get us to the final JSON response.
    
    The XML code actually remains largely unchanged, except that we're now
    dealing with this new Feed type instead of the FeedItem type we were
    using before.
    
    We'll also take this opportunity to make dealing with these populated
    scream types a bit nicer by defining a type alias for them, and then
    adding some helper functions for dealing with them directly. This is
    essentially what our old FeedItem type was in previous commits, but this
    is a bit lighter weight.
Commits on Jun 1, 2017
  1. Generate JSON feed for screams

    gfontenot committed Jun 1, 2017
    We can serve this alongside our existing xml feed. This will improve
    compatibility with certain services.
  2. Add RFC 3339 timestamp formatter

    gfontenot committed Jun 1, 2017
    This is the format used by JSON Feed
  3. Extract FeedItem into a new module

    gfontenot committed Jun 1, 2017
    This was bloating the Feed module a bit, and it's a little nicer to pull
    this out into a new module.
  4. Add helpers for rendering widgets

    gfontenot committed Jun 1, 2017
    Occasionally, it's nice to be able to render a widget as html or as
    text. To accomplish this, we can introduce some helper functions. We'll
    add them to Foundation so that they are available app wide.
Commits on May 31, 2017
  1. Refactor feeds to use FeedItem type

    gfontenot committed May 31, 2017
    Instead of passing around this specific tuple type, it's a bit nicer to
    use a wrapper type that will allow us to write some helper functions so
    that we can add some simple helpers.
  2. Extract title and description into constants

    gfontenot committed May 31, 2017
    These are going to be used in our JSON feed as well, so it's worthwhile
    to pull these out of our feed template, and into a more reusable
    location.
  3. Specify XML for the current feed format

    gfontenot committed May 31, 2017
    We're about to add JSON feeds, so it makes sense to make room for that
    by updating the current code to make it clear that it's dealing with XML
    feeds.
Commits on Apr 25, 2017
Commits on Apr 12, 2017
  1. Customize login form

    gfontenot committed Apr 12, 2017
    We want to be able to reuse this login form when authenticating for
    other purposes (like API access). To accommodate this (and to solidify my
    understanding of what is going on here) it made sense to customize this
    form and pull it into a widget.
  2. Redirect to login when unauthenticated

    gfontenot committed Apr 12, 2017
    Instead of displaying an error message when we try to access the new
    scream form, it's more useful for us to redirect to the login page,
    which will then redirect us back to the new scream form. Now I don't
    have to keep typing in that dang url.
Commits on Apr 6, 2017
  1. Allow SSL to be disabled via ENV

    gfontenot committed Apr 6, 2017
    We want to require SSL on production, but in dev and on staging it's
    actually kind of obnoxious. Lets go ahead and keep it off, but allow it
    to be enabled conditionally via ENV, which we can do on production.
Commits on Apr 4, 2017
  1. Use the singular for uploadImages

    gfontenot committed Apr 4, 2017
    We're uploading a single image, not multiple images. We should name our
    function as such.
  2. Pass media directly to the update status endpoint

    gfontenot committed Apr 4, 2017
    Instead of pulling out our media ids ahead of time, it's kind of nicer
    to pass the media itself, and then pull out the ids when we construct
    the body. This ensures that we're passing the right thing to our
    function, and gives us a _bit_ more safety.
  3. Simplify request creation logic

    gfontenot committed Apr 4, 2017
    Previously, we were using `SimpleQuery` inside our Endpoint type, but
    ultimately that meant pushing the work of creating those into the
    endpoint creation. Ultimately, I think that's probably too noisy, and
    that we can get by with a simple `(Text, Text)` representation of these
    queries.
    
    This leaves us in a bind though, because our upload endpoint is going to
    deal with ByteString already. Moving that back and forth from Text to
    ByteString seems like a waste of time, so I'd like to try to avoid that.
    
    We can solve this issue by conflating the request method and the body
    data into a sum type. We can then use this sum type to not only
    differentiate between the different body formats, but also to determine
    how to encode the particular body types for the request.
  4. Attach uploaded images to tweets

    gfontenot committed Apr 4, 2017
    Once we've uploaded our images, we want to attach them to our tweets so
    that they actually appear on the internet. I know that seems
    unimportant, but trust me, it's key to this whole thing.
  5. Upload images to Twitter

    gfontenot committed Apr 4, 2017
    If we have any images for our scream, we want to upload them to Twitter
    and then collect the result. To do this, we'll create a new endpoint for
    the uploads that accepts the raw image data.
    
    We'll also create a new type to represent the result of the request
    because annoyingly Twitter decided to use inconsistent JSON keys between
    their different endpoints.