#LoLChaMa A twitter bot to tweet a summoner's top 3 champion masteries of League of Legends (LoL) on your timeline periodically.
Demo
Description
I created this to learn Amazon Web Service(AWS) and Riot API. And I wanted to create a software at no cost. So I uses AWS Lamda to create this. And I use CloudWatdh to run Lamda function periodically. Lamda and CloudWatdh have monthly free tier usage. It's enough to run a simple bot.
And why Twitter bot? Because I didn't want to use an additional web hosting service at that time. However, AWS has a Simple Storage Service(S3) that can be a web server and has free tier usage for 12 monthes. But I wanted to run the bot long time over 12 monthes. So I chose Twitter for an output page.
Architecture is CloudWatch > Lambda > Twitter.
An entry for "[The Riot Games API Challenge 2016 (4/22 - 5/9)] (https://developer.riotgames.com/discussion/announcements/show/eoq3tZd1)" - "3. Creativity/Originality" category.
The name "LoLChama" came from LoL Champion Mastery.
Requirement
- Node.js v4.4.3 (npm 2.15.1)
- Summoner Name of League of Legends
- Riot API Key
- Twitter Consumer Key (API Key)
- Twitter Consumer Secret (API Secret)
- Twitter Access Token
- Twitter Access Token Secret
- AWS Account
- AWS IAM user for Lamda
Usage
1. Download LoLChaMa source
(Download folder example.) D:\ulg\Downloads\LoLChaMa-master
2. Setting
Unzip and open "autotweet.js".
Set summoner name and keys.
Tips : You need to save the file as UTF-8 encode.
3. Install Node packages
Open Command Prompt and Type these.
Move to the download folder. (D:\ulg\Downloads\LoLChaMa-master)
d:
cd D:\ulg\Downloads\LoLChaMa-master
Install Node packages.
npm install async
npm install twitter
npm install riot-api-client
4. Create a zip
Select only "node_modules" and "autotweet.js".
5. Create a Lambda function
Go to AWS Lambda page.
Click "Create a Lambda function".
Click "Skip" at the bottom right.
Configure function.
Name : LoLChaMa
Description : Tweet LoL Champion Mastery Top 3
Code entry type: Upload a .ZIP file
Fanction package : autotweet.zip
Handler : autotweet.handler
Role : lambda_basic_execution
Timeout : 0 min 10 sec
Click "Next".
6. Test
Check Execution result: succeeded "done".
Tips1 : You can't tweet "same message" at short times.
Tips2 : You can tweet a hidden tweet as using "@home " at the beginning of tweet.
7. Add event source
Click "Event sources" tag and click "Add event source"
Event source type : CloudWatch Event - Schedule
Rule name : LoLChaMa
Schedule expression : cron(0 6 * * ? *)
exp.) Run every 6:00 am (UTC). Schedule Expression Syntax for Rules
Click "Submit".
your timeline or #LoLChaMa
8. SeeLicence
Author
Copyright
(c) 2016. LoLChaMa isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.