In these comments people have suggested to check for the User-Agent, but wouldn't it make more sense to check if the Accept header mentions text/html? I realize that curl sends "Accept: / ", but if you wanted to see a page in plain text, you would have to pass -H "Accept: text/plain". I think that uses HTTP much more like it was intended.
You can read my blog posts using curl
11–20 of 73 posts
Re: You can read my blog posts using curl
#12Cute idea, but the first one I picked didn't work very well: https://mahdi.blog/raw/mathematical-induction-proving-tiling...
Edit: fixed it by moving the script to its own file.
Re: You can read my blog posts using curl
#13Two months ago I hacked something like that for my blog: curl https://fuse.pl/beton/10print.html # with code highlighting curl https://fuse.pl/beton/cegla.html # just prose
Re: You can read my blog posts using curl
#14In these comments people have suggested to check for the User-Agent, but wouldn't it make more sense to check if the Accept header mentions text/html? I realize that curl sends "Accept: / ", but if you wanted to see a page in plain text, you would have to pass -H "Accept: text/plain". I think that uses HTTP much more like it was intended.
Re: You can read my blog posts using curl
#15Re: You can read my blog posts using curl
#16Re: You can read my blog posts using curl
#17Example:
curl https://mahdi.blog/raw/self-hosted/ | less
Re: You can read my blog posts using curl
#18Re: You can read my blog posts using curl
#19In these comments people have suggested to check for the User-Agent, but wouldn't it make more sense to check if the Accept header mentions text/html? I realize that curl sends "Accept: / ", but if you wanted to see a page in plain text, you would have to pass -H "Accept: text/plain". I think that uses HTTP much more like it was intended.
Re: You can read my blog posts using curl
#20A cool add-on to this would be a plugin that automatically redirected /latest to the latest blog post. That way, if the blogger were to publish say once a week every Tuesday, the user could alias the curl for maximum ease of use.
EDIT: typo fixings.