Skip to content

Instantly share code, notes, and snippets.

@lvnilesh
Created July 5, 2017 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lvnilesh/e0e536424c195e91c39719a88be6f51a to your computer and use it in GitHub Desktop.
Save lvnilesh/e0e536424c195e91c39719a88be6f51a to your computer and use it in GitHub Desktop.
#!/bin/bash
file_root="/data/rec"
web_root="https://domain2.com"
micropub_endpoint=https://domain1.com/?micropub=endpoint
access_token=123123123
# Create the post via Micropub and save the URL
url=`curl -i $micropub_endpoint -H "Authorization: Bearer $access_token" \
-H "Content-Type: application/json" \
-d '{"type":"h-entry","properties":{"content":[{"html":"<p>Streaming Live</p><iframe width=\"600\" height=\"340\" src=\"https://domain2.com/index.html\"></iframe>"}]}}' \
| grep Location: | sed -En 's/^Location: (.+)/\1/p' | tr -d '\r\n'`
# Write the URL to a file
echo $url > $file_root/last-url.txt
@lvnilesh
Copy link
Author

lvnilesh commented Jul 5, 2017

The change is [ and ] after the "content":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment