gourcetools on Nostr: Could nostr image hosters add support for bash upload, here is a cool repo: And a ...
Could nostr image hosters add support for bash upload, here is a cool repo:
https://git.0x0.st/mia/0x0https://0x0.st/And a demo command:
```
#!/bin/bash
# Set the image file path
IMAGE_PATH="./plane.png"
# Upload the image using curl
response=$(curl -s -F "file=@$IMAGE_PATH"
https://0x0.st)
# Check if the response contains "http"
if [[ $response == *"http"* ]]; then
# The response is the direct URL to the image
image_url=$response
# Print the URL of the uploaded image
echo "Image uploaded successfully. URL: $image_url"
else
echo "Image upload failed. Please try again."
fi
```
Published at
2023-04-05 00:05:50Event JSON
{
"id": "6cc1ff5126484f16b3e7277cbac7d5fac7a52f9234fcefdf1b1db3f3f30acac9",
"pubkey": "0000005cc4586681ad8e7f4b75436fb7904b0e34ff072bb3406ddb90226d7eab",
"created_at": 1680653150,
"kind": 1,
"tags": [],
"content": "Could nostr image hosters add support for bash upload, here is a cool repo:\n\nhttps://git.0x0.st/mia/0x0\nhttps://0x0.st/\n\n\nAnd a demo command:\n\n```\n#!/bin/bash\n\n# Set the image file path\nIMAGE_PATH=\"./plane.png\"\n\n# Upload the image using curl\nresponse=$(curl -s -F \"file=@$IMAGE_PATH\" https://0x0.st)\n\n# Check if the response contains \"http\"\nif [[ $response == *\"http\"* ]]; then\n # The response is the direct URL to the image\n image_url=$response\n\n # Print the URL of the uploaded image\n echo \"Image uploaded successfully. URL: $image_url\"\nelse\n echo \"Image upload failed. Please try again.\"\nfi\n```\n",
"sig": "f9b96e8027e9d54e35f7baf008d5e73a772c94c8e8c9b769324e76cf0165d5a6aaa14666fe291da125204478c9eda9fa931344426216375bbfdd74d80e372af2"
}