Skip to content

Commit

Permalink
docs: fix typos & co (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset authored Oct 22, 2023
1 parent 3c8e730 commit 7623353
Show file tree
Hide file tree
Showing 21 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Touitomamout relies on two APIs:
- [Twitter-Scraper](https://github.com/the-convocation/twitter-scraper)

### Mastodon configuration
In order to communicate with the mastodon instance, you'll have to generate an API Token. It's totally free. Reminder: your application name will be publicly visible.
In order to communicate with the mastodon instance, you'll have to generate an API Token. It is totally free. Reminder: your application name will be publicly visible.
1. Go to your account's application page: `https://{yourinstance.tld}/settings/applications/new`
2. Create a new application with the following scopes:
- `read:accounts`: get your mastodon account username
Expand All @@ -55,14 +55,14 @@ In order to communicate with the mastodon instance, you'll have to generate an A

### Twitter configuration
The tweets retrieval by itself can be done without Twitter credentials. But keep in mind that twitter currently blocks guests to access users' replies.
Touitomamout is trying to restore the previous session so you'll not get spammed by the Twitter security team for each connection.
Touitomamout is trying to restore the previous session, so you'll not get spammed by the Twitter security team for each connection.


> **Note**
>
> The configuration allows you to sync a first account and authenticate with a secondary account for two reasons:
> 1. Currently, there is no simple way to authenticate with an account having 2FA enabled, so you may not want to lower your main account security.
> 2. Because this project is running with a non-official API, you may not want put your account at risk.
> 2. Because this project is running with a non-official API, you may not want to put your account at risk.

### Environment
Expand All @@ -74,7 +74,7 @@ Then, please fill each variable.
> Do not forget to properly choose the `EXECUTION` variable.
> Two values are allowed:
> 1. `manual`: a simple node script execution
> 2. `pm2`: spanws as a new PM2 process, named with `touitomamout-${instance_id}` pattern.
> 2. `pm2`: spawns as a new PM2 process, named with `touitomamout-${instance_id}` pattern.

### Multiple instances
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/configuration/cron.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ tags: [

## Define environment variables
3 types of environment variables are required to run the sync:
- **Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables)
- **Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-)
- **Cron variables**: required for the cron, get them [here](/docs/resources/environment-variables#configuration-with-cron-)
- **Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables).
- **Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-).
- **Cron variables**: required for the cron, get them [here](/docs/resources/environment-variables#configuration-with-cron-).
2 changes: 1 addition & 1 deletion docs/docs/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ There are multiple ways to run Touitomamout, all of these ways are detailed belo

In all cases you'll have to define a set of environment variables to properly shape the Touitomamout instance to your needs.

You can find the [list of all environment variables here](/docs/resources/environment-variables).
You can find a [list of all environment variables here](/docs/resources/environment-variables).

:::
6 changes: 3 additions & 3 deletions docs/docs/configuration/manual-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ tags: [

## Define environment variables
3 types of environment variables are required to run the sync:
- **Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables)
- **Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-)
- **Manual sync variables**: required for the manual sync, get them [here](/docs/resources/environment-variables#configuration-with-manual-sync-)
- **Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables).
- **Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-).
- **Manual sync variables**: required for the manual sync, get them [here](/docs/resources/environment-variables#configuration-with-manual-sync-).
6 changes: 3 additions & 3 deletions docs/docs/configuration/pm2.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ tags: [

## Define environment variables
3 types of environment variables are required to run the sync:
- **Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables)
- **Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-)
- **PM2 variables**: required for the PM2 instance, get them [here](/docs/resources/environment-variables#configuration-with-pm2-)
- **Core variables**: required in situations, get them [here](/docs/resources/environment-variables#core-variables).
- **Sync variables**: required for the sync **you** want, get them [here](/docs/resources/environment-variables#synchronization-).
- **PM2 variables**: required for the PM2 instance, get them [here](/docs/resources/environment-variables#configuration-with-pm2-).
22 changes: 11 additions & 11 deletions docs/docs/discover.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 1

Let's discover Touitomamout in less than ⏲️ **5** minutes!

First, what is Touitomamout? It is a self-hosted cross-poster from **Twitter** to **Mastodon** and / or **Bluesky**. It's a tool that allows you to sync tweets to Mastodon & Bluesky. But it also allows you to synchronize the profile picture, the name, the banner & profile description if you'd like to.
First, what is Touitomamout? It is a self-hosted cross-poster from **Twitter** to **Mastodon** and / or **Bluesky**. It is a tool that allows you to sync tweets to Mastodon & Bluesky. But it also allows you to synchronize the profile picture, the name, the banner & profile description if youd like to.

![touitomamout](/img/touitomamout-small.svg)

Expand All @@ -23,18 +23,18 @@ Here are an overview of the Touitomamout features.
:::note

Gifs & Videos are not supported on Bluesky yet. But it will be soon 🤞! Until then, tweets containing gifs or videos will
be synced without the medias. If no text and no compatible media are found, the post will be skipped during sync.
be synced without the media. If no text and no compatible media is found, the post will be skipped during sync.
:::

## How synchronization is working?
## How is synchronization working?

### Content synchronization
Touitomamout syncs tweets from the selected account every X minutes (you have to choose this while creating your instance).
If you have to understand a single thing about sync, it would be the following:
If you need to understand a single thing about sync, it would be the following:

:::tip Sync in a nutshell

Touitomamout only syncs **the content from the synced account** and only when it's **platform-agnostic**.
Touitomamout only syncs **the content from the synced account** and only when it is **platform-agnostic**.

:::

Expand All @@ -44,20 +44,20 @@ Meaning for a given synced account @ilovetouitomamout:

Here is a detailed view of what is synced or not.

| Sync eligible | Text | Image | Video | Text & Image | Text & Video | Reply | Quote | Retweet |
|------------------------------|:------:|:------:|:------:|:------------:|:------------:|:------:|:------:|:--------:|
| Tweet from synced account |||||||||
| Tweet from different account |||||||||
| Sync eligible | Text | Image | Video | Text & Image | Text & Video | Reply | Quote | Retweet |
|--------------------------------|:------:|:------:|:------:|:------------:|:------------:|:------:|:------:|:--------:|
| Tweet from synced account |||||||||
| Tweet from a different account |||||||||

### Profile synchronization
This process is totally optional and **can be disabled** from the `.env` configuration file. You're able to chose to synce the following items:
This process is totally optional and **can be disabled** from the `.env` configuration file. You're able to chose to sync the following items:
1. 📸 Profile picture
2. 📜 Biography
3. 🌄 Banner
4. 🔤 Profile name

## What does Touitomamout rely on to work?

The project relies on [Twitter Scraper](https://github.com/the-convocation/twitter-scraper) to access the data from Twitter. Since it's not an official way of connecting to Twitter, please take into account the data retrieval can sometimes be slow down or broken.
The project relies on [Twitter Scraper](https://github.com/the-convocation/twitter-scraper) to access the data from Twitter. Since it is not an official way of connecting to Twitter, please take into account the data retrieval can sometimes be slow down or broken.
Some filtering & configuration rules are taken into account to output the list of posts to sync.
Finally, posts are provided to Mastodon & Bluesky by relying on the [atproto](https://github.com/bluesky-social/atproto) and [masto.js](https://github.com/neet/masto.js) libraries.
4 changes: 2 additions & 2 deletions docs/docs/resources/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: Environment variables

# Environment variables

In order to configure the application, you have to provide environment variables. You'll find here the list of all the
environment variables by type of usage. `(📌 means the variable is required for the context where it is defined)`
To configure the application, you have to provide environment variables. You'll find here the list of all the
environment variables by usage. `(📌 means the variable is required for the context where it is defined)`

## Core variables

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/resources/storage/auth-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Auth system
---

# Auth system
To prevent Touitomamout to re-authenticate at each run, the application is storing the authentication tokens in a file.
To prevent Touitomamout to re-authenticate at each run, the application stores the authentication tokens in a file.
A `Cookies` file is always named with the following naming: `cookies.<source-twitter-username>.json`.

**Take care of this file!**
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/resources/storage/cache-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Storage system
---

# Cache system
In order to resume the sync process where it stopped, Touitomamout is keeping track of the already synced tweets. This is done by storing the tweet's id in a file.
To resume the sync process where it stopped, Touitomamout keeps track of the already synced tweets. This is done by storing the tweet's id in a file.
A `Cache` file is always named with the following naming: `cache.<source-twitter-username>.json`.

## Cache file location
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/resources/twitter-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: Twitter autentication

# Twitter Authentication

Touitomamout is leveraging the [Twitter Scrapper](https://github.com/the-convocation/twitter-scraper) project to
Touitomamout leverages the [Twitter Scrapper](https://github.com/the-convocation/twitter-scraper) project to
retrieve Twitter's data.

Even if you are technically allowed to use by Touitomamout without passing a Twitter username & password, the data we're
Even if you are technically allowed to use by Touitomamout without passing a Twitter username & password, the data we are
able to retrieve from it is pretty limited (euphemism). That's why we **_highly_** recommend you to provide twitter
credentials.

Expand All @@ -34,7 +34,7 @@ able to automate its tasks without having to wait for a human to input a code re

> The only way to authenticated with Twitter is to provide credentials for an account with 2FA **disabled**
(Tip: sms, google | dashlane | other authenticator apps = **OFF**).
(Tip: sms, google | dashlane | other authenticator apps = **OFF**).

## No guaranty regarding the account you will log in with ❗

Expand All @@ -48,5 +48,5 @@ official Twitter webapp. Meaning we can get the data for free as a regular user
Since this technique is not official at all nor especially legal, the recommendation is to rely on a secondary account you
could accept to lose or get restricted.

Until now (date of writing), no account of the author has been impacted in any way. But we cannot garranty anything,
let's be cautious
Until now (date of writing), no account of the author has been impacted in any way. But we can't guarantee anything,
let's be cautious.
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const config = {
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
projectName: 'louisgrasset.github.io', // Usually your repo name.
organizationName: 'louisgrasset', // Usually your GitHub org/user name.
organizationName: 'louisgrasset', // Usually your GitHub org name / username.

trailingSlash: false,

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/medias/parse-blob-for-bluesky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface BlueskyBlob {
}

/**
* An async method to convert a Blob to an upload-compatible Bluesky Blob
* An async method to convert a Blob to an upload-compatible Bluesky Blob.
* @returns BlueskyBlob
*/
export const parseBlobForBluesky = async (blob: Blob): Promise<BlueskyBlob> => {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/medias/upload-bluesky-media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BskyAgent } from '@atproto/api';
import { parseBlobForBluesky } from './parse-blob-for-bluesky.js';

/**
* An async method to upload a media to Bluesky
* An async method to upload a media to Bluesky.
* @returns the bluesky media references
*/
export const uploadBlueskyMedia = async (mediaBlob: Blob, blueskyClient: BskyAgent | null) => {
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/post/get-post-excerpt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* A utility method to get a status excerpt
* A utility method to get a status excerpt/
* @param status
*/
export const getPostExcerpt = (status: string) => ${status.replaceAll('\n','').substring(0,25)}... »`;
2 changes: 1 addition & 1 deletion src/helpers/url/shortened-urls-replacer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getRedirectedUrl } from './get-redirection.js';

/**
* A utility method to replace t.co urls with the original url
* A utility method to replace t.co urls with the original url.
*/
export const shortenedUrlsReplacer = async (text: string): Promise<string> => {
const TWITTER_URL_SHORTENER = /https:\/\/t\.co\/\w+/g;
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
} = await configuration();

/**
* Let the magic happens 💫
* Let the magic happens 💫.
*/
const touitomamout = async () => {
if (SYNC_MASTODON && !mastodonClient) {
Expand All @@ -38,7 +38,7 @@ const touitomamout = async () => {
await touitomamout();

if(DAEMON){
console.log(`Run dameon every ${DAEMON_PERIOD_MIN}min`);
console.log(`Run daemon every ${DAEMON_PERIOD_MIN}min`);
setInterval(async () => {
await touitomamout();
}, DAEMON_PERIOD_MIN * 60 * 1000);
Expand Down
4 changes: 2 additions & 2 deletions src/services/bluesky-sender.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { mediaDownloaderService } from './index.js';
const MASTODON_MEDIA_IMAGES_MAX_COUNT = 4;

/**
* An async method in charge of handling Bluesky posts computation & uploading
* An async method in charge of handling Bluesky posts computation & uploading.
*/
export const blueskySenderService = async (client: BskyAgent | null, post: BlueskyPost | null, medias: Media[], log: Ora) => {
if(!client || !post) {
Expand Down Expand Up @@ -57,7 +57,7 @@ export const blueskySenderService = async (client: BskyAgent | null, post: Blues
}
}

// When no compatible media has been found and no text is present, skip the post
// When no compatible media has been found and no text is present, skip the post.
if(!mediaAttachments.length && !post.tweet.text) {
log.warn(`☁️ | post skipped: no compatible media nor text to post (tweet: ${post.tweet.id})`);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/services/mastodon-sender.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { mediaDownloaderService } from './index.js';
const BLUESKY_MEDIA_IMAGES_MAX_COUNT = 4;

/**
* An async method in charge of handling Mastodon posts computation & uploading
* An async method in charge of handling Mastodon posts computation & uploading.
*/
export const mastodonSenderService = async (client: mastodon.rest.Client | null, post: MastodonPost | null, medias: Media[], log: Ora) => {
if (!client || !post) {
Expand Down Expand Up @@ -49,7 +49,7 @@ export const mastodonSenderService = async (client: mastodon.rest.Client | null,
}
}

// When no compatible media has been found and no text is present, skip the post
// When no compatible media has been found and no text is present, skip the post.
if (!mediaAttachments.length && !post.tweet.text) {
log.warn(`🦣️ | post skipped: no compatible media nor text to post (tweet: ${post.tweet.id})`);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/services/media-downloader.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* A method to download the media
* A method to download the media.
*/
export const mediaDownloaderService = (url: string): Promise<Blob | null> => {
return fetch(url)
Expand Down
2 changes: 1 addition & 1 deletion src/services/posts-synchronizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { tweetsGetterService } from './index.js';
import { mastodonSenderService } from './mastodon-sender.service.js';

/**
* An async method in charge of dispatching posts synchronization tasks for each received tweets
* An async method in charge of dispatching posts synchronization tasks for each received tweets.
*/
export const postsSynchronizerService = async (twitterClient: Scraper, mastodonClient: mastodon.rest.Client | null, blueskyClient: BskyAgent | null, synchronizedPostsCountThisRun: Counter.default): Promise<SynchronizerResponse & { metrics: Metrics }> => {
const tweets = await tweetsGetterService(twitterClient);
Expand Down
2 changes: 1 addition & 1 deletion src/services/profile-synchronizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Platform, SynchronizerResponse } from '../types/index.js';
import { mediaDownloaderService } from './index.js';

/**
* An async method in charge of dispatching profile synchronization tasks
* An async method in charge of dispatching profile synchronization tasks.
*/
export const profileSynchronizerService = async (twitterClient: Scraper, mastodonClient: mastodon.rest.Client | null, blueskyClient: BskyAgent | null): Promise<SynchronizerResponse> => {
const log = ora({ color: 'cyan', prefixText: oraPrefixer('profile-sync') }).start();
Expand Down

0 comments on commit 7623353

Please sign in to comment.