Coder Social home page Coder Social logo

random-tweeter's Introduction

Random Tweeter

Randomly tweets a Twitter tweet from a pool of potential tweets.

Usage

Switch to node vX.X

nvm use

Packaged As A Lambda Function

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.

To Run Locally, Simulating A Deployed Lambda Running

sls offline start

Then you can call the endpoint at http://localhost:8000/tweet

To Run Locally Once And Then Exit The Process

sls invoke

Twitter Credentials

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"   
  } 
}

Configuring The Tweet Pool

The "tweetpool.json" file can be modified to change the content of the tweets in the tweet pool.

================================

Uses Serverless AWS Clojurescript Gradle Template

This project compiles Clojurescript to a NodeJS module using the Gradle Clojure Plugin.

NodeJS Support

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.

Prerequisites

Build and Deploy

  • To build, run ./gradlew clean build
  • To deploy, run serverless deploy

Using the Repl in IntelliJ Cursive IDE

This project contains a script the must be initialized in order to use the Repl in IntelliJ.

From Scratch Guide

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

random-tweeter's People

Contributors

jimlynchcodes avatar

Stargazers

 avatar

Watchers

 avatar  avatar

random-tweeter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.