Search all your tweets.
git clone https://github.com/you/mytweets
cd mytweets
This application require following tokens:
You need to put these to .env
file.
cp .env.example .env
.env
fileS3_AWS_ACCESS_KEY_ID="x"
S3_AWS_SECRET_ACCESS_KEY="x"
S3_AWS_REGION="us-east-1"
S3_BUCKET_NAME="x"
TWITTER_APP_KEY="YOUR_TWITTER_API_KEY"
TWITTER_APP_SECRET="YOUR_TWITTER_API_KEY_SECRET"
TWITTER_ACCESS_TOKEN="YOUR_TWITTER_ACCESS_TOKEN"
TWITTER_ACCESS_SECRET="YOUR_TWITTER_ACCESS_TOKEN_SECRET"
Example Permission policies:
YOUR_S3_BUCKET_NAME
is the bucket name of Step 1
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "mytweets",
"Effect": "Allow",
"Action": "s3:*",
"Resource": "arn:aws:s3:::{your-mytweets-bucket-name}/*"
}
]
}
.env
fileS3_AWS_ACCESS_KEY_ID="x"
S3_AWS_SECRET_ACCESS_KEY="x"
S3_AWS_REGION="us-east-1"
S3_BUCKET_NAME="x"
TWITTER_APP_KEY="YOUR_TWITTER_API_KEY"
TWITTER_APP_SECRET="YOUR_TWITTER_API_KEY_SECRET"
TWITTER_ACCESS_TOKEN="YOUR_TWITTER_ACCESS_TOKEN"
TWITTER_ACCESS_SECRET="YOUR_TWITTER_ACCESS_TOKEN_SECRET"
If you want to get Bluesky posts, you can use yarn run fetch-bsky
instead of yarn run fetch-tweets
.
.env
.S3_AWS_ACCESS_KEY_ID="x"
S3_AWS_SECRET_ACCESS_KEY="x"
S3_AWS_REGION="us-east-1"
S3_BUCKET_NAME="x"
BLUESKY_IDENTIFIER="xxx.bsky.social"
BLUESKY_APPPASSWORD="x"
yarn run fetch-bsky
instead of yarn run fetch-tweets
in [update workflow](./.github/workflows/update.ymltwitter-*.zip
tweeet*.js
to twitter-archives/
twitter-archives/
├── tweet.js
├── tweet-part1.js
└── tweet-part2.js
yarn install
yarn import-twitter-archives # Concvert twitter-archives
yarn fetch-tweets # Fetch diffs via Twitter API
yarn upload-s3 # upload to S3
Require:
TWITTER_*
andS3_*
env in.env
file
Fetch the latest tweets from your Twitter account using Twitter API.
yarn fetch-tweets
command fetch tweets and merge it into tweets.json
.
yarn upload-s3
upload the tweets.json
to your S3 bucket.
yarn install
yarn download-s3 # download tweets.json from S3
yarn fetch-tweets # Fetch diffs via Twitter API
yarn prefetch-bsky # Fetch diffs via Bluesky API
yarn upload-s3 # upload to S3
You can deploy web frontend to Web Hosting like Vercel.
web/
to "Root Directory"S3_AWS_ACCESS_KEY_ID
S3_AWS_SECRET_ACCESS_KEY
S3_BUCKET_NAME
NEXT_PUBLIC_AUTH_KEY=<secure random string>
NEXT_PUBLIC_AUTH_KEY
"public"
to NEXT_PUBLIC_AUTH_KEY=public
https://<yourmytweets>.vercel.app/?k=<NEXT_PUBLIC_AUTH_KEY>
.https://<yourmytweets>.vercel.app/?k=<NEXT_PUBLIC_AUTH_KEY>&q=<search keyword>&max=<max search count>
The web app support following url queries:
?k=<Your Secret Key - same with NEXT_PUBLIC_AUTH_KEY>
&q=<search keyword>
&max=<max search count>
20
You can automate yarn fetch-tweets
and yarn upload-s3
using CI like GitHub Action.
This template repository includes .github/workflows/update.yml that update your tweets.json
daily.
https://github.com/owner/mytweets/settings/secrets/actions
S3_AWS_ACCESS_KEY_ID
S3_AWS_SECRET_ACCESS_KEY
S3_AWS_REGION
S3_BUCKET_NAME
TWITTER_APP_KEY
TWITTER_APP_SECRET
TWITTER_ACCESS_TOKEN
TWITTER_ACCESS_SECRET
BLUESKY_IDENTIFIER
BLUESKY_APPPASSWORD
These value is same to .env
.
See Releases page.
Install devDependencies and Run npm test
:
npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu