Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alextes/twitter_v1_oauth
Make twitter v1.1 API authorization headers.
https://github.com/alextes/twitter_v1_oauth
oauth oauth1 oauth1-client oauth1a twitter-api
Last synced: 16 days ago
JSON representation
Make twitter v1.1 API authorization headers.
- Host: GitHub
- URL: https://github.com/alextes/twitter_v1_oauth
- Owner: alextes
- Created: 2021-06-17T13:25:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-25T16:17:49.000Z (over 1 year ago)
- Last Synced: 2025-01-01T10:17:55.384Z (19 days ago)
- Topics: oauth, oauth1, oauth1-client, oauth1a, twitter-api
- Language: TypeScript
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Twitter v1.1 OAuth
Helps build the authorization header for the twitter v1.1 API. _The library does not support the full v1.1 API!_
## Limitations
- Only the `GET` request method is supported.## Usage
```ts
import { makeOAuthHeader } from "https://deno.land/x/twitter_v1_oauth/mod.ts";fetch(
"https://api.twitter.com/1.1/lists/members.json?list_id=1393929153997647873&count=500",
{
headers: {
"Authorization": makeOAuthHeader(
{
baseUrl: "https://api.twitter.com",
method: "GET",
oauthAccessToken:
"1366753588047978500-lOQ1dMdKnYmkuVMXEkPT2TfIQbE460",
oauthConsumerKey: "IBt8XVwLWS8pNpYEDxLh2mp2M",
oauthConsumerSecret: Deno.env.get("OAUTH_CONSUMER_SECRET")!,
oauthTokenSecret: Deno.env.get("OAUTH_TOKEN_SECRET")!,
pathname: "/1.1/lists/members.json",
queryParameters: {
count: "500",
list_id: "1393929153997647873",
},
},
),
},
},
);
```