Skip to content

An AWS labda that connects as an account proxy to Twitter API

License

Notifications You must be signed in to change notification settings

mifkata/twitter-client-aws-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter client proxy AWS lambda

This is a lambda which can be used to proxy requests to Twitter's API, using AWS Lambda. It uses BoyCook/TwitterJSClient to make. limited, but 100% compliant API calls and can be easily extended to do more.

Live demo via AWS Gateway API endpoint

Installation

Clone this repository and install the missing npm packages.

cd twitter-client-aws-lambda
npm install

Deploying to AWS lambda

Before deploying, make sure that you have configured config.js and replaced the required API keys with yours.

In order to deploy the package, either use the aws-cli tool or zip the contents of the repository (node_modules included!) and upload them to AWS lambda using the user interface

API Specs

Since this is a proxy service, it is going to need an AWS Gateway API endpoint to be generated for it eventually. The HTTP API, performs differently and accepts different parameters based on the action provided.

This lambda is made to handle data being sent in both query strings or request body, so you can use either POST or GET for your requests to the lambda.

?action=search

This is your standard Tweet search, the API accepts the following parameters:

  • q - search string
  • max_id - used for pagination, the API will provide search_metadata.next_max_id in your search responses
  • count - amount of results to be returned
  • geocode - lonlat location with radius
  • locale - origin user locale
  • lang - search language

?action=userSearch

Search through the Twitter user accounts. Accepted parameters:

  • q - search string
  • page - search results page
  • count - number of results returned per page

?action=postsByUserId

Retrieves posts by Twitter User ID:

  • id

?action=postsByScreenName

Retrieves posts by Twitter screen name, params:

  • screen_name

?action=tweet

Retrieves a single tweet by ID, params:

  • id

About

An AWS labda that connects as an account proxy to Twitter API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published