Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
158 lines (150 sloc) 4.01 KB
omg: 1
info:
version: 1.0.0
title: Twitter
description: Twitter as a microservice
license:
name: MIT
url: https://opensource.org/licenses/MIT
contact:
name: Asyncy
url: https://asyncy.com
email: hello@asyncy.com
lifecycle:
startup:
command: ["python", "/app/app.py"]
actions:
# https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-create.html
follow:
help: Follow an user
arguments:
handle:
type: string
in: requestBody
help: The screen name of the user to follow.
user:
type: int
in: requestBody
help: The ID of the user to follow.
follow:
type: boolean
in: requestBody
help: Enable notifications for the target user.
http:
path: /follow
method: post
port: 8000
output:
type: map
# https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/post-friendships-destroy
unfollow:
help: Unfollow an user
arguments:
handle:
type: string
in: requestBody
help: The screen name of the user to unfollow.
user:
type: int
in: requestBody
help: The ID of the user to unfollow.
http:
path: /unfollow
method: post
port: 8000
output:
type: map
# https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-followers-list
followers:
help: |
Returns a cursored collection of user objects for users following the specified user.
At this time, results are ordered with the most recent following first — however, this ordering is subject to unannounced change and eventual consistency issues. Results are given in groups of 20 users and multiple “pages” of results can be navigated through using the `next_cursor` value in subsequent requests.
arguments:
handle:
type: string
in: requestBody
help: The screen name of the user for whom to return results.
user:
type: int
in: requestBody
help: The ID of the user for whom to return results.
cursor:
type: int
in: requestBody
help: Causes the results to be broken into pages. If no cursor is provided, a value of -1 will be assumed, which is the first “page.”
range:
min: -1
count:
type: int
in: requestBody
help: The number of users to return per page, up to a maximum of 200. Defaults to 20.
range:
min: 1
max: 200
skip_status:
type: boolean
in: requestBody
help: When set to either true, statuses will not be included in the returned user objects. If set to any other value, statuses will be included.
http:
path: /followers
method: post
port: 8000
output:
type: map
retweet:
help: Retweet a tweet
arguments:
tweet:
in: requestBody
type: int
required: true
http:
path: /retweet
method: post
port: 8000
output:
type: map
tweet:
help: Tweet a message
arguments:
status:
type: string
in: requestBody
required: true
http:
path: /tweet
method: post
port: 8000
output:
type: map
stream:
help: Stream tweets
events:
tweet:
arguments:
filter:
in: requestBody
type: string
help: Filter tweets that container this hashtag
http:
port: 8000
subscribe:
method: post
path: /stream/subscribe
contentType: application/json
unsubscribe:
path: /stream/unsubscribe
method: post
output:
type: map
environment:
CONSUMER_KEY:
required: true
type: string
CONSUMER_SECRET:
required: true
type: string
ACCESS_TOKEN:
type: string
ACCESS_TOKEN_SECRET:
type: string