Inspiration
I've used 1&1 for a ton of domain and hosting related services for different organizations and clubs I've been a part of. Love the product and service. Never heard of 1&1 Cloud Server but it seemed like a cool product! Why not try out the API challenge (says every hackathon-goer)? So...there were no Amazon Alexas left in the hardware lab. Crap. Can't do voice command. Oh well. Cortana? Nah. Twitter app? Nope. Chrome extension? Eh. Facebook chat bot? Yassss.
What it does
This Facebook bot allows admins of 1&1 Cloud Server accounts to spin up or delete servers from their accounts (and also show information about the servers on the account).
How I built it
I used 1&1 Cloud Server's API along with node.js to create a Facebook messenger bot, hosted on Heroku (since that was really fast deployment).
Challenges I ran into
Getting set up wasn't too bad. The Facebook bot worked great! Until I tried integrating the API (which had wrappers for Perl, PHP, and Python...none of which I had chosen for my app). I used Postman to test my API calls, which helped a lot. The node.js app also kept crashing on Heroku if I used promises for some reason (ugh). So getting the messages to be posted in the correct order was a pain. When I tried displaying all of the servers on an account, I didn't realize I was dealing with a string instead of an array. So when I went to iterate over everything from i=0 to i=body.length, I crashed my Facebook, Heroku, and phone. Oh my. Bless JSON.parse(). I was debugging everything in production by deploying every little change to Heroku...
Accomplishments that I'm proud of
I learned so much during this time (see below) and have something that I can use on the go! (Though I wouldn't really need to manage many servers, haha).
What I learned
- How to create a Facebook messenger bot
- How to use promises in node.js (even though I didn't end up using that in the hack)
- How to use Postman to test API calls
- How to make an API call, GET/POST/DELETE requests
- How to convince my friends to help look through my code
What's next for 1&1 Cloud Server FMI (Facebook Messenger Interface)
Would love to get all of the API options in! (Sadly, I only got to the main functions for the server...there were so many more opportunities). Also, I wanted to try out the other functions with Facebook messenger's bots! Could've had more user inputs to alter the servers (description, performance options, etc...). And of course, natural language processing!
Built With
- 1&1-cloud-server
- facebook-chat
- heroku
- json
- node.js
Log in or sign up for Devpost to join the conversation.