Pesquise todos os seus tweets.
git clone https://github.com/you/mytweets
cd mytweets
Este aplicativo requer os seguintes tokens:
Você precisa colocá-los no arquivo .env
.
cp .env.example .env
.env
S3_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"
Exemplo de políticas de permissão:
YOUR_S3_BUCKET_NAME
é o nome do intervalo da Etapa 1
{
"Version" : " 2012-10-17 " ,
"Statement" : [
{
"Sid" : " mytweets " ,
"Effect" : " Allow " ,
"Action" : " s3:* " ,
"Resource" : " arn:aws:s3:::{your-mytweets-bucket-name}/* "
}
]
}
.env
S3_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 "
Se você deseja obter postagens do Bluesky, você pode usar yarn run fetch-bsky
em vez de 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
em vez de yarn run fetch-tweets
em [fluxo de trabalho de atualização](./.github/workflows/update.ymltwitter-*.zip
tweeet*.js
para 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
Exigir:
TWITTER_*
eS3_*
env no arquivo.env
Obtenha os tweets mais recentes da sua conta do Twitter usando a API do Twitter.
O comando yarn fetch-tweets
busca tweets e mescla-os em tweets.json
. yarn upload-s3
carrega o tweets.json
para o seu bucket S3.
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
Você pode implantar front-end da web em hospedagem na web como Vercel.
web/
como "Diretório raiz"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"
como 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>
O aplicativo da web oferece suporte às seguintes consultas de URL:
?k=<Your Secret Key - same with NEXT_PUBLIC_AUTH_KEY>
&q=<search keyword>
&max=<max search count>
20
Você pode automatizar yarn fetch-tweets
e yarn upload-s3
usando CI como o GitHub Action.
Este repositório de modelos inclui .github/workflows/update.yml que atualiza seu tweets.json
diariamente.
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
Esse valor é igual a .env
.
Consulte a página de lançamentos.
Instale devDependencies e execute npm test
:
npm test
Solicitações pull e estrelas são sempre bem-vindas.
Para bugs e solicitações de recursos, crie um problema.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu