Motivation
I recently developed a bot to scour the steemit blockchain for images and post comments containing exif information. This experience taught me something.
- Bots are not always perfect
- Users may find this feature more useful if it were less automatic
Sure, getting exif information is really useful; however, it's kinda spam. Given, it's information that should automatically be in the post already, but it's not (Maybe I will contribute it to condenser). The bot is an afterthought kind of thing where it comes in after a post is already made and updates a very visible comment (something that it would be nice to optionally hide/show).
I started to re-examine priorities and I found that it's probably not readers that will find the bot so useful as other programmers that want to get at that data; therefore, posting it in a comment as markdown is also a very ineffective feature. It also dawned on me that all I've been contributing is bots. Bots are pretty much spam machines. I came to realize that real contributions are probably microservices that make data more available/obvious to programmers that want to use it when building better user interfaces, features, etc...
I have made a microservice that makes exif data readily available. Developers have but to use an http client to query the data. jQuery or NodeJS can be used to query from the server or a browser. This makes this very useful.
Technical Details
This project was built using:
- Typescript
- Docker
- ExifReader
- Bluebird
- Got
- Docker
It is then deployed to Heroku via Docker.
Usage
You can use this microservice in a couple ways:
- Run the microservice locally and offer it to other users
- Use the microservice via a client
Running
This describes how to run the microservice locally
To install and use this bot, you will be required to install Docker.
When Docker is installed and the environment variables are set, installation and execution are a single docker command:
docker run --rm -p 3000:3000 r351574nc3/steem-exif-spider-bot:latest
Running on a different port
export PORT=8090
docker run --rm -e PORT=$PORT -p $PORT:$PORT r351574nc3/steem-exif-spider-bot:latest
Getting records with curl
The url is made up of the author
and permlink
of the post you want exif details about. For example, for an author (alexanderfluke) and permlink (quarry-5-pics), my command is:
curl https://steemit-exif-ms.herokuapp.com/alexanderfluke/quarry-5-pics
Using JQ
Pretty Printing
curl https://steemit-exif-ms.herokuapp.com/alexanderfluke/quarry-5-pics | jq .
Fetch Make and Model
curl https://steemit-exif-ms.herokuapp.com/alexanderfluke/quarry-5-pics | jq '.[] | { make: .Make.description, model: .Model.description }'
{
"make": "Canon",
"model": "Canon EOS 450D"
}
{
"make": "Canon",
"model": "Canon EOS 450D"
}
{
"make": "Canon",
"model": "Canon EOS 450D"
}
{
"make": "Canon",
"model": "Canon EOS 450D"
}
Roadmap
- Create a plugin to make it accessible from javascript frameworks in browser.
- Browser extensions that allow viewing exif data for images in steemit on mouseover.
Contributing
Posted on Utopian.io - Rewarding Open Source Contributors