Open Valian opened 1 week ago
@Valian Yeah, that sounds good to me 👍
I had the same exact idea! I'm using Req
for my use case, and have essentially re-implemented Readability.summarize
to work on raw html responses and URLs. +1
While we are here (and since that might be a breaking change from the API perspective anyways), should we discuss renaming summarize
? I don't think it's the best name as it does not technically summarize anything, just extracts different parts of the webpage.
Some thoughts about simplifying the api:
Readability.article(html)
, as proposed above, returns an %Article{}
structure with all the fields populated.Readability.{title, published_at}
etc. functions - they don't add much to the table (just parse the article and grab the fields you need).Readability.article_from_file(filename)
and such.Some downsides of this approach:
Right now there's
Readability.summarize(url)
function fetching the article and then parsing it.I'm thinking about:
httpoison
from dependenciesReadability.article(html)
as an entrypoint to the library, with the expectation that user will get HTML on his ownWhy?
Thoughts? Maybe @vkryukov @philipbrown ?