Giter Club home page Giter Club logo

feed's Introduction

Reads Feed

Greenkeeper badge

Logo

Sharing my "Open tabs / Read Later" list, as I go through it. You can follow Reads Feed also on Twitter and Tumblr. Also it's alive in its own static website: Github Pages

Purpose

Concept of this project is:

  • You add some links to a json file, by using a CLI helper
  • Push the changes
  • And the links you just added will be automatically published to your Twitter and Tumblr accounts. Plus, a static site will be deployed to Github Pages.

Development

Node and npm versions

$ npm -v
6.1.0

$ node -v
v10.6.0

Setting it up for the first time

# Clone
git clone [email protected]:scriptype/feed.git
cd feed

# Clean .git
rm -rf .git
git init

# Reset the artifacts
rm links.json
rm -rf public/data
mkdir public/data
echo "[]" > public/data/all.json
echo "[]" > links.json

# This file will have secret tokens for Twitter and Tumblr
cp .env.example .env

# Install dependencies
npm i

More setting up before adding links

Configure github pages to serve docs directory.

And, of course, you will need to register OAUTH applications on Twitter and Tumblr.

When you got the necessary auth tokens and secrets, make sure to keep them safe and never commit them to the version control.

Now, it's the time to replace the placeholder secrets in the .env file you created with the actual secrets you obtained from Twitter and Tumblr. .env file is in .gitignore, so it's safe to save secrets into this file.

Add some links!

Use the add helper in the root of the project. Run:

./add

This will ask:

  • Url
  • Title
  • Tags

Shortly after answering these questions, it will:

  • Share the link in a tweet, with tags turned into hashtags,
  • Share the link as a link post in Tumblr,
  • Push changes made in links.json file docs/data folder to GitHub, effectively deploying changes to the GitHub Pages.

However, if you provide a tweet url (that is, a url in the form of: https://twitter.com/[username]/status/[tweetId]), it will:

  • Also ask for an optional quote (message) for the retweet
  • Retweet the given tweet on Twitter account
  • Attempt to extract link information from the tweet (assuming the tweet is sharing a link)
  • And use this information to save that link and publish that link in other channels as usual.

Adding links manualy

If, for any reason, you can't or don't want to use ./add helper, you can manually add links by appending this for each link to links.json:

{
  "url": "link url",
  "title": "link title",
  "tags": ["some", "tags", "here"]
}

Then you need to run:

node scripts/generate-data.js | node scripts/publish.js
git add links.json docs
git commit -m "Add: [url of the link you added]"
git push

Local development of frontend (gh-pages)

# Run dev server to serve `/docs`
npm run dev

Tests

No tests.

Licence

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. You just DO WHAT THE FUCK YOU WANT TO.

feed's People

Contributors

dependabot[bot] avatar greenkeeper[bot] avatar scriptype avatar

Watchers

 avatar  avatar

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.