Skip to content

Commit

Permalink
make image links and readme links absolute to work in obsidian
Browse files Browse the repository at this point in the history
  • Loading branch information
kbravh committed Nov 7, 2021
1 parent 397e647 commit 91ccf6d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 19 deletions.
26 changes: 13 additions & 13 deletions BearerTokenGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,62 @@ In order to get a bearer token for the Twitter V2 API, you'll need to set up an

First, head over to the [Twitter developer dashboard](https://developer.twitter.com/en/portal/dashboard). If you're not logged in to your Twitter account (or if you don't have one yet), you'll be prompted to login or create an account.

![Twitter login screen](images/twitter_dashboard_login.png)
![Twitter login screen](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/twitter_dashboard_login.png)

Next, you'll be asked to choose your use case. I recommend choosing Hobbyist; if you choose Professional or Academic, Twitter will try to upsell you to their paid API access.

![Twitter asks for your API use case](images/use_case.png)
![Twitter asks for your API use case](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/use_case.png)

When the submenu appears, choose Exploring the API. Then click **Get Started**.

![Hobbyist sub menu](images/hobbyist_submenu.png)
![Hobbyist sub menu](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/hobbyist_submenu.png)

Next, Twitter will have you fill out a form with basic information to set up your developer account. At the top you'll see your Twitter account and email address, and at the bottom you'll be asked for your name. There is also a dropdown that asks for your coding skill level. You can answer however you like! Twitter just uses this to determine how much information to show you later on.

![Basic info for developer account](images/basic_info.png)
![Basic info for developer account](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/basic_info.png)

Twitter will then ask how you plan to use the API. You can use the following explanation if you like, or come up with your own (it just needs to be at least 200 characters).

> I will be using the API in conjunction with the Tweet to Markdown tool in order to save the text and images of tweets into the Obsidian note taking application for archival purposes. This will be entirely for personal use.
![An explanation of the API usage](images/api_usage_explanation.png)
![An explanation of the API usage](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/api_usage_explanation.png)

You can also turn off all of the toggles that follow this text box.

![Twitter asks about how you'll analyze tweets](images/tweet_analysis_toggles.png)
![Twitter asks about how you'll analyze tweets](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/tweet_analysis_toggles.png)

On the next two pages you'll be asked to review the information you've provided and to accept the developer agreement policy and terms of use of the API. Once you do so, go ahead and click **Submit Application**! You might see a screen asking you to verify your email address.

![Verify your email address](images/email_verification.png)
![Verify your email address](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/email_verification.png)

## Set up bearer token
Once you've submitted you developer application and verified your email address, you'll see the developer dashboard. Click on **Create project**.

![Developer dashboard](images/developer_dashboard.png)
![Developer dashboard](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/developer_dashboard.png)

Twitter will then walk you through setting up a project. First, set a name for the project. This is mainly to help you keep track of what this bearer token will be used for, in case you ever set up others.

![Name your project](images/name_your_project.png)
![Name your project](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/name_your_project.png)

Next, Twitter will again ask about your use case. You can choose *Exploring the API*.

![Project use case](images/project_use_case.png)
![Project use case](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/project_use_case.png)

Then, you'll need to set a project description. You can write your own or use the same one we used earlier.

> I will be using the API in conjunction with the Tweet to Markdown tool in order to save the text and images of tweets into the Obsidian note taking application for archival purposes. This will be entirely for personal use.
![Project description](images/project_description.png)
![Project description](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/project_description.png)

Once you've filled out the project details, you will need to set an App name. This app name will need to be globally unique. How about `<your name> + Tweet to Markdown`?

![App name](images/app_name.png)
![App name](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/app_name.png)

Finally, Twitter will show your API access information! For this project, you'll only need the bearer token in the last box.

Nota bene: Save this information somewhere safe! If you leave this page before saving your key, you'll have to generate a new one. If you ever need to generate a new key, click on *Keys and tokens* under your app name and click **Regenerate** next to the bearer token box.

![Regenerate the bearer token if you lost it](images/regenerate.png)
![Regenerate the bearer token if you lost it](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/regenerate.png)

## Success!

Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Karey Higuera

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<br />
<p align="center">
<a href="https://github.com/kbravh/obsidian-tweet-to-markdown">
<img src="images/obsidian-ttm-logo.svg" alt="Logo" height=200>
<img src="https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/obsidian-ttm-logo.svg" alt="Logo" height=200>
</a>

<h3 align="center">Tweet to Markdown</h3>
Expand Down Expand Up @@ -33,7 +33,7 @@ Or, if you'd like to install it manually, clone this repository to the `.obsidia
## Usage

### Bearer token
To use this tool, you'll need to set up an application and get a bearer token on the [Twitter developer dashboard](https://developer.twitter.com/en/portal/dashboard). For a guide on doing so, see [Getting a bearer token](BearerTokenGuide.md). Once you have the bearer token, you can paste it into the bearer token field on the Tweet to Markdown settings page. If you'd rather protect the token a bit more, you can store it in the environment variable `TWITTER_BEARER_TOKEN`.
To use this tool, you'll need to set up an application and get a bearer token on the [Twitter developer dashboard](https://developer.twitter.com/en/portal/dashboard). For a guide on doing so, see [Getting a bearer token](https://github.com/kbravh/obsidian-tweet-to-markdown/blob/main/BearerTokenGuide.md). Once you have the bearer token, you can paste it into the bearer token field on the Tweet to Markdown settings page. If you'd rather protect the token a bit more, you can store it in the environment variable `TWITTER_BEARER_TOKEN`.

Nota bene: On Unix machines, make sure to set this in your profile file (such as `~/.bash_profile`) so that it will be available to Obsidian.

Expand All @@ -43,15 +43,15 @@ Either click the Twitter logo in your sidebar or run the command `Download Tweet

To download a tweet thread, paste the link to the **LAST** tweet in the thread, and toggle the Thread switch.

![The modal to download a new tweet.](images/tweet_url_modal.png)
![The modal to download a new tweet.](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/tweet_url_modal.png)

Once the tweet is downloaded, you'll be presented a window to set the name of the file that will be created. You can use the variables `[[handle]]`, `[[name]]`, and `[[id]]` when naming your file, which will be automatically replaced with the author's handle, name, and the tweet ID.

![The modal to name a downloaded tweet.](images/tweet_complete_modal.png)
![The modal to name a downloaded tweet.](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/tweet_complete_modal.png)

The tweet will be saved to a Markdown file in the root of your vault, or in the directory specified in your settings. Here's how the tweet will look:

![The rendered Markdown file](images/markdown_screenshot.png)
![The rendered Markdown file](https://raw.githubusercontent.com/kbravh/obsidian-tweet-to-markdown/main/images/markdown_screenshot.png)

Any attached images, polls, and links will also be linked and displayed in the file.

Expand Down Expand Up @@ -83,7 +83,7 @@ Contributions are what make the open source community such an amazing place to l

## License

This project is licensed under the MIT License - see the [ `LICENSE` ](LICENSE) file for details
This project is licensed under the MIT License - see the [ `LICENSE` ](https://github.com/kbravh/obsidian-tweet-to-markdown/blob/main/LICENSE) file for details

<!-- CONTACT -->

Expand Down

0 comments on commit 91ccf6d

Please sign in to comment.