Skip to content

ulgg/LoLChaMa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

#LoLChaMa A twitter bot to tweet a summoner's top 3 champion masteries of League of Legends (LoL) on your timeline periodically.

Demo

#LoLChaMa

image

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.

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

  1. Node.js v4.4.3 (npm 2.15.1)
  2. async
  3. twitter
  4. riot-api-client
  5. Summoner Name of League of Legends
  6. Riot API Key
  7. Twitter Consumer Key (API Key)
  8. Twitter Consumer Secret (API Secret)
  9. Twitter Access Token
  10. Twitter Access Token Secret
  11. AWS Account
  12. AWS IAM user for Lamda

Usage

1. Download LoLChaMa source

(Download folder example.) D:\ulg\Downloads\LoLChaMa-master
image

2. Setting

Unzip and open "autotweet.js".
image

Set summoner name and keys.
Tips : You need to save the file as UTF-8 encode.
image

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

image

4. Create a zip

Select only "node_modules" and "autotweet.js".
image

And right click > send > zip.
image

5. Create a Lambda function

Go to AWS Lambda page.
Click "Create a Lambda function".
image

Click "Skip" at the bottom right.
image

Configure function.
Name : LoLChaMa
Description : Tweet LoL Champion Mastery Top 3
Code entry type: Upload a .ZIP file
Fanction package : autotweet.zip
image

Handler : autotweet.handler
Role : lambda_basic_execution
image

Click "Allow".
image

Timeout : 0 min 10 sec
Click "Next".
image

Click "Create function".
image

6. Test

Click "Test".
image

Click "Save and test".
image

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.
image

7. Add event source

Click "Event sources" tag and click "Add event source"
image

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".
image image

image

Licence

MIT

Author

ulg

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.

Releases

No releases published

Packages

No packages published