我有一个斯莱克小组与一群朋友,我们总是分享Spotify链接。我希望这些链接被自动添加到一个大Spotify播放列表中,所以我想出了一个解决方案,使用Zapier来弥补这个差距。因为我只想使用免费的层,它需要两个单独的Zaps来实现这一点。许多在线解决方案提供了将Spotify与Slack同步的方法,但这提供了相反的方法。
发布于 2018-08-20 14:00:03
Zapier完全能够在一个Zap中处理这个特定的任务,诀窍是它超过了自由层的三个动作限制,所以我不得不将它分解成两个Zaps,一个处理#music Slack通道中的筛选Spotify链接,另一个解析URL并提取轨道的Spotify ID并将其发布到播放列表中。
筛选器过滤到板条通道的链接
- Slack Trigger -> New Message Posted to Channel -> Continue
- Connect the Slack account you want to use -> Continue
- Channel -> #music (or whatever the channel your group uses for music)
- Trigger for Bot Messages -> No -> Continue
- Only continue if... -> Continue
- From dropdowns select Text -> (Text) Contains -> [https://open.spotify.com/track/](https://open.spotify.com/track/) -> Continue
- Slack Trigger -> Send Channel Message -> Continue
- Connect the Slack account you want to use -> Continue
- Select the channel you created in step 1
- Message Text -> From the dropdown to the right, select New Message Posted To Channel -> Click the arrow to the right and choose the Text field
- There's a bunch bot settings you can customize if you feel so inclined here as well
- Broadcast to channel -> no -> Continue
Spotify播放列表
- Slack Trigger -> New Message Posted to Channel -> Continue
- Connect the Slack account you want to use -> Continue
- Channel -> #spotify-links -> Continue
- Trigger for Bot Messages -> Yes -> Continue
- Text -> Text -> Continue
- Transform -> Exact pattern
- Values -> Input -> Select dropdown to the right -> New Message Posted to Channel -> Text
- I found a regex that would select just the Spotify ID out of the URL, even if there is a query string, as Spotify often adds one to their sharing links.
- Pattern -> `[^\/][\w]+(?=\?)` -> Continue 1. Add a Spotify Action -> Continue
- Create -> Add Track to Playlist -> Continue
- Connect Spotify account you want to use -> Continue
- Playlist -> Choose the playlist you want to add the music to on Spotify. If you haven't created it yet, go to Spotify and create a new public playlist
- Track -> Use Custom Value(advanced)
- Custom Value for Track Track ID -> Choose 2 Text from the dropdown -> Continue
那应该让你滚开。一定要测试你的数据,并确保事情顺利进行。
https://stackoverflow.com/questions/51932404
复制相似问题