Code Monkey home page Code Monkey logo

bookmarks-to-notion's Introduction

Twitter Bookmarks To Notion

A simple Python + Flask web app that demonstrates how to export Twitter Bookmarks to a Notion page.

You can try a deployed version of the app running on Glitch.

Sign up for the Twitter API

Setup

  1. Obtain consumer key and secret from the Twitter Developer portal. The app should be configured to enable Sign in with Twitter.
  2. Obtain OAuth client ID and OAuth client secret from the Notion Developer portal. See twitter_auth.py for more details, but you can either:
    1. add these values to a config.cfg file (local deployment); or
    2. set environment variables TWITTER_CLIENT_ID and TWITTER_CLIENT_SECRET (cloud deployment)
    3. set environment variables NOTION_CLIENT_ID and NOTION_CLIENT_SECRET (cloud deployment)
  3. Setup a pipenv environment, and install dependencies:
    1. pipenv install
    2. pipenv shell
  4. Start the app:
    1. python3 ./twitter_auth.py; or
    2. gunicorn twitter_auth:app

Note: the app must have an Internet-accessible URL - do not attempt to connect via localhost, as this will not work. You can run a tunnel e.g. ngrok for local use, or deploy to a cloud platform such as Heroku (a Procfile is included).

Open a browser window on your demo app's external URL. Don't click the buttons yet!

Finally, add the appropriate redirect URLs in developer portal for both Notion and Twitter. Also add these, as environment variables TWITTER_REDIRECT_URI and NOTION_REDIRECT_URI in your config.cfg (local deployment) or as environment variables (cloud deployment).

Reference

Twitter Developer Portal
Notion API Docs

Credits

Original version of Twitter OAuth login by Jacob Petrie
https://twitter.com/jaakkosf
https://github.com/jaakko-sf/twauth-web

bookmarks-to-notion's People

Contributors

sparack avatar andypiper 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.