You can post messages to a specific bloon from elsewhere using a webhook and some very simple code. Specifically, by sending an HTTP POST request to the webhook URL for that bloon, you can post a message directly to its message board.
Go to the console in the BLOON web app.
Navigate to Webhooks. Click on "+ NEW" to generate a new webhook URL.
Select a bloon. The new webhook URL will point to this bloon.
Your webhook URL is ready.
Once a webhook URL has been generated for a bloon, a message can be posted to the message board by sending an HTTP POST request to the URL in this format:
POST https://api.bloon.io/webhooks/lX789VG8TaWkn9xSZrkZDw
Content-type: application/json
{
"content": "Hi, there. I'm Webhook Bot!"
}
HTTP POST requests can be sent using various utilities. Here is an example using cURL. Simply swap out https://api.bloon.io/webhooks/lX789VG8TaWkn9xSZrkZDw
for your own webhook URL.
curl -X POST -H 'Content-type: application/json' \
--data '{"content": "Hi, there. I'\''m Webhook Bot!"}' \
https://api.bloon.io/webhooks/lX789VG8TaWkn9xSZrkZDw
Once the request goes through, the message will appear with a "BOT" tag on the message board of the associated bloon.
A direct link is a URL that gives direct access to sharelinked material. When you use a sharelink to access a file, you still need to click "Download". With a direct link, just point your browser to it and the file will start downloading immediately. This enables access using Wget or cURL.
To convert a sharelink to a direct link, simply replace the "www
" subdomain in the sharelink with "direct
".
For example, this is a sharelink:
https://www.bloon.io/share/mZZWRYiU
This is the direct link for the same item.
https://direct.bloon.io/share/mZZWRYiU
Generating sharelinks is covered here. Scroll down to "Creating sharelinks".
This is a direct link for a folder:
https://direct.bloon.io/share/orhwQqSd
If you open the link in a browser, you'll see:
BLOON LOGO/
landscape-with-trees-and-mountains.jpg
toast.jpg
vintage-car-in-front-of-house.jpg
This is simply a list of all the items in the folder, as opening the corresponding sharelink reveals:
https://www.bloon.io/share/orhwQqSd
The list always has these characteristics:
- plain text with UTF-8 encoding;
- one item per line;
- each line ends in the character '\n'; and
- folder name ends in character '/'.
The list of items can be parsed using any programming language. Any item can be directly accessed by appending its name as a slug to the direct link for the parent folder.
For example, this URL downloads "toast.jpg".
https://direct.bloon.io/share/orhwQqSd/toast.jpg
"BLOON LOGO" is a sub-folder. Directly linking to it ...
https://direct.bloon.io/share/orhwQqSd/BLOON%20LOGO
... yields a plain-text list of its contents.
If there are sub-sub-folders within "BLOON LOGO", you can work with them in the exact same manner described above.
"%20" is the URL-encoded representation for spaces.
Given the above, you can create a public, customized static webpage by following these steps:
-
Download and install the BLOON desktop and log in through it.
-
Create a new folder in any bloon.
-
Create a sharelink to this folder.
-
Create an empty text file within this folder.
-
Name it "test.html".
-
Open "test.html" in any text editor and paste the following. Be sure to save in UTF-8 encoding.
<!DOCTYPE html>
<html>
<head>
<title>HELLO, WORLD</title>
<meta charset="UTF-8" />
</head>
<body>
<h1>What a Wonderful World
<span class="red-heart">❤</span>
</h1>
</body>
</html>
- Convert the sharelink you just created into a direct link, and append "/test.html" to it. It should look something like this:
https://direct.bloon.io/share/[a sharelink ID]/test.html
- Open the link in any browser, and you should see your static page!
Remember, BLOON doesn't store your files in the cloud. At least one copy of your file needs to be online for your static page to be accessible.
If you need to brush up on your HTML, Mozilla's got you covered.
Let's add some style to our webpage following these steps:
-
Create an empty text file within the folder we created in Step 2 of the last section.
-
Name it "test.css".
-
Now edit "test.css" so that it looks like this:
.red-heart{
color: red;
}
- Edit "test.html" so that it looks like this (by adding "
<link>
" tag):
<!DOCTYPE html>
<html>
<head>
<title>HELLO, WORLD</title>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<h1>What a Wonderful World
<span class="red-heart">❤</span>
</h1>
</body>
</html>
- Our static page now looks like this — the heart icon becomes red.
In this example, we've used a relative path to access a CSS file.
You can set up a static website using a free template. Here's how:
-
Create a new folder in any bloon.
-
Create a sharelink to that folder.
-
Download this free Bootstrap theme. (You'll have to click on "Free Download".)
-
Unzip the .zip once it's downloaded.
-
Move the unzipped contents to the folder you created in Step 1, so that index.html, README.md and so on are directly under that folder.
-
The BLOON symbol in the menu bar (Mac) or taskbar (Windows) will have now changed to . Wait for it to change back to . This could take a little bit of time.
-
Convert the sharelink you created in Step 2 into a direct link, and append "/index.html" to that. You should end up with something like this:
https://direct.bloon.io/share/[a sharelink ID]/index.html
Open this link in any browser. You will find a website up and running, based on the template you downloaded. You can start editing and customizing it right away using HTML, CSS, and Javascript.
One more thing. Try opening the direct link for the folder without "index.html" appended.
https://direct.bloon.io/share/[a sharelink ID]/
You will still land on the same page. This is because direct links for folders automatically point to the file in the folder named "index.html" or "index.htm", if there is one. This allows for simpler, more elegant URLs.
Bootstrap isn't for everybody every time, but "bootstrap theme" is a good keyphrase to start with when searching for free templates.
Websites hosted with BLOON can be paired with custom domain names. You can also take advantage of web caching.
By default, your site is accessed via direct link. A direct link looks like this:
https://direct.bloon.io/share/[a sharelink ID]/
Your site can also be accessed via a hosting link that looks like this:
https://kjy9vz.bloon.io
The hosting link is shorter; more importantly, it's a subdomain. It enables us to use custom domain names as well as activate BLOON's web caching facility, if we so choose.
To get a hosting link, go to Web Hosting Settings and click on "+ NEW." The equivalent link that is generated also doubles as hosting link.
When web caching is enabled, any resource up to 2 MB in size accessible via hosting link will be cached on BLOON's servers upon being accessed via a caching-enabled hosting link. Going forward, it can then be served directly from BLOON's servers for faster response.
You can enable web caching in Web Hosting Settings.
Files over 2 MB will be served from your machine regardless of whether web caching is enabled.
Web caching is disabled by default, and must be enabled separately for each hosting link. BLOON is essentially a P2P sharing and file management service; BLOON does not cache your data in the cloud unless you manually enable this on a specific basis.
Keep in mind that web caching only provides for faster access. It does not provide access to resources that would otherwise be inaccessible. When there are no copies of a certain resource online, it is cleared from the web cache even if web caching remains enabled for the hosting link.
A hosting link is a subdomain. This means a DNS hosting provider can point any subdomain name to your website using a CNAME record.
Normally, though, you would expect to be able to go the DNS settings page for the domain name you've purchased — "example.com", let's say — and add CNAME records to point subdomains such as "www" or "blog" to your hosting link (e.g. "kjy9vz.bloon.io"). This would give access to your site via www.example.com or blog.example.com, using your custom domain name.
However, since BLOON hosting links only allow HTTPS access, at this point your custom subdomain would return a certificate error. This is because while your data is located behind the IP address of a BLOON cloud server, your custom subdomain does not match BLOON's certificate.
You could resolve this problem by setting up a reverse proxy server and using your own certificate, or a free certificate from Let's Encrypt. If you don't want to set up a reverse proxy server yourself, you could use a CDN service with HTTPS support. Cloudflare, for example, offers free plans that provide HTTPS access as well as free certificates.
You could also enable HTTPS for your site using AWS CloudFront — Amazon's paid CDN service — in tandem with free public certificates from AWS Certificate Manager. CloudFront is blazing fast, and modestly priced as long as traffic is not exceedingly heavy. You could also use AWS Route53 for DNS; this would also enable you to point your domain name ("example.com") — not just subdomains ("www.example.com") — to your website.
Normally, CNAME records can only point to a subdomain, not a root domain. This restriction can be bypassed using CloudFront and Route 53 together, since both services are provided by AWS and can coordinate internally.