docbrown/app
Francisco Quintero 3b939f6b9f
[deploy] Add Reddit Liquid Tag (#8111)
* Implement Reddit liquid tag

* Set reddit content in locals

* Change Reddit liquid tag content layout

I decided a UI similar to the Stack Exchange tag would be better.

Now the Reddit tag looks a bit similar.

* Add tests for RedditTag

* Add reddit liquid tag example to docs

Also emphasize notice about compilation of article when using any
liquid tag

* Parse markdown text reddit content for RedditTag

* Display date RedditTag post was published

* Remove file location comments

* Change order of conditional for Reddit liquid tag

Sometimes the attribute `post_hint` might be null and neither condition
would apply.

* Add example to use Reddit liquid tag

* Change reddit svg icon for Reddit liquid tag

* handle and verify status of Reddit links

Here we make sure the passed link is a valid one in terms of URI composition (e.g. protocol)
but also that the URL is one that points to existing content in Reddit.

If the URL isn't returning anything but a successful response code (200) then
we treat it as an invalid one.

* Do not use VCR for RedditTag specs

The generated cassette for this tag was really huge (6000+ lines).

Using mocks (as in the MediumTag spec) still does the job and without
that huge VCR file.

* Remove index line from schema.db

* Improve RedditJsonFromUrlService

- Change User-Agent in requests to one read from app configuration
- Remove Reddit URL check by making a GET request
- Add regexp to validate URL looks like a Reddit URL

* Move RedditJsonFromUrlService methods to RedditTag

Also changed the way the request was being mocked. Previously, it was by
mocking the service class now I'm mocking HTTParty directly and returning
the JSON structure Reddit uses.
2020-06-01 18:52:07 -04:00
..
assets [deploy] Add Reddit Liquid Tag (#8111) 2020-06-01 18:52:07 -04:00
black_box [deploy] Remove Google Analytics page counts (#6969) 2020-04-14 10:44:05 -04:00
controllers Add Health Check Endpoint for Cache (#8222) 2020-06-01 15:19:56 -05:00
dashboards [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
decorators [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
errors [deploy] Create FastlyConfig & refactor params safe list (#7630) 2020-05-01 11:23:48 -04:00
fields Enables Rails cops (#2186) 2019-03-25 09:25:55 -04:00
helpers [deploy] Change default fetch format in cloudinary links (#8226) 2020-06-01 17:53:04 -04:00
javascript [deploy] Optimization: Remove Comment Count From Aysnc user_data (#8174) 2020-06-01 10:38:57 -05:00
labor [deploy] Optimization: Remove Unused Fields From Async user_data, optimize a couple other methods (#8173) 2020-05-31 13:21:32 -05:00
lib Add merveilles.town to list of Mastodon instances (#7983) 2020-05-20 17:48:46 -04:00
liquid_tags [deploy] Add Reddit Liquid Tag (#8111) 2020-06-01 18:52:07 -04:00
mailers Update the tag moderation email (#8048) 2020-05-28 17:46:41 +02:00
models feat: update the DEV Digest to be fully dynamic (#8213) 2020-06-01 13:56:29 -04:00
policies [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
queries/internal Refactor internal users index (#7457) 2020-04-24 17:27:07 -04:00
sanitizers Add support for mark element in markdown (#2089) 2019-03-18 17:10:58 -04:00
serializers [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00
services [deploy] Fix badge count update after merge (#8210) 2020-06-01 14:01:46 -04:00
uploaders Limit ALL Upload file sizes to 25 MB (#5356) [deploy] 2020-01-07 11:20:40 -05:00
view_objects [deploy] Fix height/width mismatch (#7485) 2020-04-23 13:38:10 -04:00
views [deploy] Add Reddit Liquid Tag (#8111) 2020-06-01 18:52:07 -04:00
workers [deploy] Rename classified listings (#7910) 2020-05-27 13:35:09 +00:00