posting the contents of a markdown file to posterous with curl

513 Views Asked by At

I want to push my blog posts with curl. the body of my blogpost is contained in a markdown file post.md

I am trying the following command:

curl -vX POST --user login:pwd -d "api_token=mytoken" -d post[body]=<post.md -d "post[title]=titre;post[is_private]=true;post[autopost]=false" http://posterous.com/api/2/sites/mysite/posts

The post is made with an empty body (or rather a "\n" body). How can I fix that ?

1

There are 1 best solutions below

0
Daniel Szmulewicz On

This works:

curl -vX POST --user login:pwd -d "api_token=mytoken" --data-urlencode "post[body]@post.md" -d "post[title]=titre;post[is_private]=true;post[autopost]=false" http://posterous.com/api/2/sites/mysite/posts