- ãããªã«ï¼
- ã¢ããã¼ã·ã§ã³
- 使ã£ãæè¡
- 工夫ãã¤ã³ã
- 2024/06/14 13:28 追è¨ï¼ãã³ã¡ã¬ã¹
ãããªã«ï¼
RSSãã£ã¼ããä»»æã®ãã¼ã¯ã¼ãã§çµãè¾¼ãã çµæãããã«å¥ã®ãã£ã¼ãã¨ãã¦è¿ãããã®proxyçãªã¦ã§ãã¢ããªã§ãã
ã¢ããã¼ã·ã§ã³
åã¯Slackã§è²ã ãªRSSãã£ã¼ããè³¼èªãã¦ãã¾ãã
YouTubeã®ãã£ã³ãã«ã«ãRSSãã£ã¼ããåå¨ãã¦ããã®ã§Slackã§è³¼èªãã¦ãã¾ãã
ä¾ãã° 東映アニメーション公式YouTubeチャンネル - YouTube ã«ã¯ããªãã¥ã¢ãã¯ããã¨ãã¦æ§ã ãªåç»ãå ¬éããã¦ãã¾ãããã®ä¸ã§ããªãã¥ã¢ã«é¢ä¿ããåç»ã ããSlackã§è³¼èªãããã£ã¦ãã¨ãããããããä½ãã¾ããã
2ã3å¹´åãããã«ä½ã£ã¦å人Slackå ã§ã»ãã¼ãã¨éç¨ãã¦ããã®ã§ãããOSSåããæ©éãé«ã¾ã£ãã®ã§OSSåãã¾ããã
2024/06/21 19:59 追è¨
å人slackã ã¨ããããã¯ã¨ãªã§feedãsubscribeãã¦ãã¾ã
使ã£ãæè¡
- Go
- Bootstrap
- Vue.js
工夫ãã¤ã³ã
é å¸å½¢å¼ãã©ãããã
Webãµã¼ãã¹ã¨ãã¦å ¬éããã®ãèããã®ã§ãããè²ããªã¨ããã§ä½¿ããã ãã¨Google Cloudã®å人ã¢ã«ã¦ã³ãã®Cloud RunãCloud Functionsã®ç¡ææ ãä¸ç¬ã§å¹ãé£ã³ãããªæ°ãããã®ã§Dockerã¤ã¡ã¼ã¸ããã¤ããªã§ã®é å¸ã«ãã¦ãã¾ãã
ã¡ãªã¿ã«ãã®ç»é¢ã¯ãã¼ã«ã«ã§åããã¦ããã®ãæ®å½±ããã®ã§localhostã«ãªã£ã¦ã¾ãããå®éã¯Slackbotããã¢ã¯ã»ã¹ã§ããå ´æã«ç½®ãå¿ è¦ãããã®ã§èªåã®å¥½ããªå ´æã«Dockerã¤ã¡ã¼ã¸ããã¤ããªãåããã¦å©ç¨ãã¦ãã ããã
åã®ããããã¯Cloud Runã§ãTerraformã®ãµã³ãã«ã³ã¼ããç½®ãã¦ãã¾ãã https://github.com/sue445/feed_squeezer/tree/main/_examples/gcp_cloud_run_terraform
Goã§Googleã©ã¤ã¯ãªæ¤ç´¢ã¯ã¨ãªã§æååããããããããªé¢æ°ãä½ã£ã
AAA BBB
: ANDæ¤ç´¢AAA | BBB
: ORæ¤ç´¢(AAA BBB) | CCC
,(AAA | BBB) CCC
: æ¬å¼§ãã¤ãã¦æ¤ç´¢æ¡ä»¶ã®åªå é ä½ä»ã
å ·ä½çã«ã¯ https://github.com/alecthomas/participle ã¨ãããã¼ãµã¼ã©ã¤ãã©ãªãç¨ãã¦å®è£ ãã¾ããã
participleã¯æ±ç¨çãªãã¼ãµã¼ã©ã¤ãã©ãªãªã®ã§ä½¿ãã®ãé£ããã£ãã®ã§ãããChatGPTã«å©ãã¦ããããªããå®è£ ã§ãã¾ããã
åå¾ãããã£ã¼ããä¸ç¬ã ããã£ãã·ã¥ãã
Slackã§ãã£ã¼ããè³¼èªããæ㯠/feed subscribe
*1 ã使ãã¾ãã
ç»é²ããããã£ã¼ãã¯10ã15åãããããã«Slackbotã«ããè³¼èªãã§ãã¯ãå®è¡ããã¾ãã
ãã®æã«Slackbotã¯åä¸ã®URLã«å¯¾ãã¦ã»ã¼åæã«HEADã¨GETãå®è¡ãã¾ãã
YouTubeãã£ã³ãã«ã®ãã£ã¼ãã«ã¯çæéãªããRateLimitãè¨å®ããã¦ãããããç¬éçã«ããããå¼ã³åºãã¨429ã¨ã©ã¼ï¼Too Many Requestsï¼ã«ãªãã¾ãã
ãã®429ã¨ã©ã¼ãåé¿ããããã«ãã£ãã·ã¥ãå°å ¥ãã¾ããã
ãã¤ããªã«viewãå梱ãã
feed_squeezerã«æ¸¡ãurlãqueryãªã©ã®ãã©ã¡ã¼ã¿ã¯URLã¨ã³ã³ã¼ãã£ã³ã°ããå¿ è¦ãããã¾ãã
æã§URLã¨ã³ã³ã¼ãã£ã³ã°ããã®ã¯å¤§å¤ãªã®ã§ããæãã«å¤æããããã®ãã©ã¼ã ãããããã¼ã¸ã«ç¨æãã¦ãã¾ãã
Goã® https://pkg.go.dev/embed ãç¨ãã¦HTMLãã¡ã¤ã«ããã¤ããªã«å«ãã¦ãã¾ãã
ãã ãjsãcssãªã©ããã¤ããªã«å«ããã¨ãã¤ããªãµã¤ãºã大ãããªãããã ã£ãã®ã§HTMLãã¡ã¤ã«ã§å©ç¨ãã¦ããBootstrapãVue.jsãªã©ã¯CDNçµç±ã§åç §ããããã«ãã¾ããã
ã¡ãªã¿ã«ãããOSSåããåã®feed_squeezerã®ç»é¢ã§ããBootstrapãå ¥ããã ãã§å ¨ç¶éããªï½
æè¿ã®ã¨ã³ã·ã¹ãã ã«ä¹ã£ãã
ä»ã¾ã§Go製ã®ãã¼ã«ãä½ãæã¯ãã¤ããªãªãªã¼ã¹ã¨ãCIã§ã®lintå®è¡ã¨ãã¯ãªã¬ãªã¬å®è£ ãæµç¨ãã¦ãã®ã§ããããã®æ©ä¼ã« https://github.com/goreleaser/goreleaser ã https://github.com/golangci/golangci-lint ã«ãåææ¦ãã¾ããã
2024/06/14 13:28 追è¨ï¼ãã³ã¡ã¬ã¹
çµãã®ã«ç¹åããYahoo! Pipesã¿ãããª
ãªãã»ã©ãYahoo! Pipesã¯å ¨ç¶ç¥ããªãã£ãã§ã