Randomly tweets a Twitter tweet from a pool of potential tweets.
Switch to node vX.X
nvm use
This project uses the serverless project template, so the project is build to be dployed as a lambda function. However, you can still just always run it locally if you wish.
sls offline start
Then you can call the endpoint at http://localhost:8000/tweet
sls invoke
When you POST to the send tweet
endpoint, send in your Twitter credentials like this:
{
"creds": {
"consumer_key": "XXXXXXXXXXXXXXX",
"consumer_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"access_token": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"access_token_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
}
The "tweetpool.json" file can be modified to change the content of the tweets in the tweet pool.
================================
This project compiles Clojurescript to a NodeJS module using the Gradle Clojure Plugin.
Rudimentary support for loading/using NodeJS modules is provided.
See functions.cljs as an example.
To include NodeJS dependencies, modify build.gradle and add the module to the closurescript .. npmDeps
section.
- Create an Amazon Web Services account
- Install and set-up Serverless Framework CLI
- Install Java 8
- Install NPM
- Install Clojure
- Install Gradle
- To build, run
./gradlew clean build
- To deploy, run
serverless deploy
This project contains a script the must be initialized in order to use the Repl in IntelliJ.
If you would like to recreate this project from scratch you can follow the below documented steps.
This project was scaffodled with the serverless aws-clojurescript-gradle template!
sls create --template aws-clojurescript-gradle
Installed "twit" javascript twitter library
npm i twit
Added "serverless-offline" as a plugin in serverless.yml
:
plugins:
- serverless-offline