> For the complete documentation index, see [llms.txt](https://endroll.gitbook.io/sample/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://endroll.gitbook.io/sample/master.md).

# TwitterToLineNotify 安裝

**本教學以**[**比村老師**](https://twitter.com/strangestone?lang=zh-tw)**作範例**

**以下以中文環境作為教學**

**首先請先準備以下工具**

* [**IFTTT**](https://ifttt.com) **帳號 (可以經由Google帳號申請)**<br>
* [**Heroku**](https://www.heroku.com/) **帳號**<br>
* [**LineNotify**](https://notify-bot.line.me/) **帳號 (line帳號登入即可)**<br>
* [**Twitter**](< https://twitter.com>) **帳號**<br>

&#x20;    1\. 登入 LineNotify 申請一個權杖(token) 先將 Notify(機器人) 設定好群組與名稱 **取得token後請複製起來**

<div align="center"><img src="/files/-Lq1eOYX99wrCn3dZoIy" alt="登入後選擇個人頁面"></div>

![選擇發行存取權杖](/files/-Lq1fith8ofc-T8cyy7F)

![將 Notify bot 選擇要發送訊息群組或是自己 選擇完後會獲得一組Token](/files/-Lq1hCAt8gvaqeFJHPV-)

&#x20;    2\. 按下[​ ](https://heroku.com/deploy?template=https://github.com/EndRollModel/TwitterToLineNotify)["此處"](https://heroku.com/deploy?template=https://github.com/EndRollModel/TwitterToLineNotify) 將專案匯入 並且將剛剛申請好的Token填入選項中\
&#x20;         Heroku專案匯入完成後 **點選右上角的 openapp 複製該網址**

![上方 : 幫你的專案取名  下方 : 把剛剛獲得的token貼上 按下deploy等他跑](/files/-Lq1jVyNg9iNgvZhQCBV)

![等待完成後 點選專案名稱內 右上方會有 open app 點擊他 跳出的分頁複製網址](/files/-Lq1kR0RRFMzx_CeMzqn)

&#x20;   3\. IFTTT 選擇頭像後 選擇 Create 後 \
&#x20;   IF 選擇 Twitter -> New tweet from search 這裡輸入你想追蹤的推主/對象 (可使用[進階搜尋](https://twitter.com/search-advanced?lang=zh-tw)方式指定追蹤)

* 範例 : 包含此處字詞 : `月曜日のたわわ その 「 」` , 來自這些帳號 : `@Strangestone` 確定後\
  搜尋串會獲得 `月曜日のたわわ その 「 」 from:Strangestone` 將此串貼在 IFTTT

&#x20;     &#x20;

![if 選擇 twitter](/files/-Lq1ltUNhJYgFrbSQDOM)

![ 選擇 New tweet from search    ](/files/-Lq1n6PYbaUo5-XY5u4M)

![以範例為貼上建立](/files/-Lq1oMkuq2atZqmHqa08)

&#x20;   4\. IFTTT than 選擇 WebHooks 後 除了url需要自己從heroku取得外 Body請直接複製貼上進去

* URL 貼上 步驟2取得的 `herokuAPPurl`
* Method 選擇 `post`
* Content Type 選擇 `application/json`
* Body 填入 `{"text": {{Text}} , "LinkToTweet": {{LinkToTweet}} }`

![then 選擇 webhook](/files/-Lq1q5HO4HmD0r0zEU85)

![依照內容填入 url 則填入剛剛的heroku url body則複製上方內容](/files/-Lq1r8ADKYyW_XEuFNRA)

&#x20;   5\. 回到 Line 將 LineNotify 邀請進入當初設定的群組 Enjoy!

![等待比村老師發文 結束!](/files/-Lq1wb4YBGRn8TBeVsP5)
