Giter Club home page Giter Club logo

kindlefy's Introduction

icon example

Send diverse contents to your Kindle ๐Ÿ“š๏ธ

typescript typescript typescript

๐Ÿ“Œ Overview

That's a way to automatically sync data with your kindle, such as RSS feeds, manga, and too much more.

๐ŸŽฉ Getting Started

This repository is a Github Action so you can configure a cron job with Github Actions to run it and sync the contents with your kindle in the way to prefer.

Below you can see an example of a configuration yaml that syncs contents with kindle every day at midnight (be aware to pass the sender credentials as github secrets to avoid exposing it to the public):

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  kindlefy:
    runs-on: ubuntu-latest
    name: Sync kindle contents.
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Kindlefy
        uses: gbkel/[email protected]
        with:
          kindle_email: '[email protected]'
          sender: '[{ "type": "gmail", "email": "[email protected]", "password": "password" }]'
          sources: '[{ "type": "manga", "name": "One Piece" }, { "type": "rss", "url": "https://dev.to/feed" }]'
          storage: '[{ "type": "local", "githubAccessToken": "${{ secrets.GITHUB_TOKEN }}" }]'
          no_duplicated_sync: true

Sender

We recommend you to create a new email to use as a sender since some services need to disable extra auth in other to be able to send emails by smtp.

Core Options

  • type - gmail, outlook, smtp - Type of sender to use.
  • email - String - Sender email to use to send the documents to kindle.

Gmail

In order to use Gmail, you need to Enable 2FA, Create an App-Specific Password.

  • email - String - The email you use to login in gmail.
  • password - String - The app-specific password you created for email.

Example:

{
	"type": "gmail",
	"email": "[email protected]",
	"password": "yourpassword"
}

Outlook

  • email - String - The email you use to login in outlook.
  • password - String - The password you use to login in outlook.

Example:

{
	"type": "outlook",
	"email": "[email protected]",
	"password": "yourpassword"
}

SMTP

  • host - String - Server host.
  • user - String - Server user.
  • password - String - Server user's password.
  • port - String - Server port.

Example:

{
	"type": "smtp",
	"email": "[email protected]",
	"host": "host",
	"user": "user",
	"password": "password",
	"port": "port"
}

Source

All the sources has some options to customize it during import. The contents usually come in descending creation order. You are able to see these options below:

Core Options

  • order - asc, desc - Documents ordination.
  • count - Number - Amount of documents to sync.
  • type - manga, rss - Type of source to sync.

Manga

The manga source by default sets count: 1 and order: desc to retrieve the last most recent chapter.

  • name - String - Manga name to search for.

Example:

  • Sync the last One Piece manga chapter:
{
	"type": "manga",
	"name": "One Piece"
}

RSS

The RSS source by default sets order: desc and splitRSSPosts: false to return all posts in publish date descending order.

  • url - String - RSS feed link.
  • splitRSSPosts - Boolean - Set to true if you want every post to be a new document inside your kindle.

Example:

  • Sync all the last dev.to feed posts in the same document:
{
	"type": "rss",
	"url": "https://dev.to/feed",
	"splitRSSPosts": false
}

Storage

In case you want to avoid duplicated sync, you can use a storage to save sync history. After adding a storage config, you need to set the 'no_duplicated_sync' environment variable to true in order to use it.

Core Options

  • type - local - Type of storage to use.

Local

It saves the sync history inside the repository this action is currently running on. You need to give Kindlefy a github access token in order to edit the repository, usually when we are using a Github Action, it automatically sets up a variable called 'GITHUB_TOKEN' on the build context that can be used as shown in the .yml example in the start of the readme.

  • githubAccessToken - String - Github access token to give the Github Action write/read access to the repository it is running in.

Example:

  • Using Github repository to save sync history:
{
	"type": "local",
	"githubAccessToken": "github access token"
}

๐Ÿ•‹ Features

  • Send to Kindle by Gmail.

  • Send to Kindle by Outlook.

  • Send to Kindle by a generic SMTP Server.

  • Import Manga.

  • Import RSS Feed.

  • Import Full Medium RSS Feeds.

  • Use a database to persist sync history and avoid data duplication on kindle (such as using MongoDB, Github Repository, etc).

  • Turn every rss post into a single document inside Kindle.

  • Choosing which collection to put the documents.

  • Sending more than one document per mail.

  • Using an own Docker Image (builded with the Dockerfile inside this repo) to improve action speed.

๐Ÿ”ง Technologies

  • Typescript
  • Husky
  • Lint Staged
  • ESLint
  • Git Commit Message Linter
  • Cheerio
  • Nodemailer
  • Calibre

๐Ÿš€ Development Environment

You just need to clone this repository inside your machine and run the following commands:

npm install
npm run dev

Obs:

  • It is needed to have Calibre installed locally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.