Created
October 24, 2024 01:18
-
-
Save mackuba/ce5fe79c08b38a6d2990c31ce267a387 to your computer and use it in GitHub Desktop.
Script for following hashtags for my hashtag feed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# make sure you have Ruby installed, should be installed by default on macOS & Linux | |
# install Minisky lib with: [sudo] gem install minisky | |
# then run with: ruby follow_hashtag.rb somehashtag | |
require 'minisky' | |
if !File.exist?('config.yml') | |
puts "Create a config.yml file with contents like this:" | |
puts | |
puts "id: my.username.dev" | |
puts "pass: app-pass-word" | |
exit 1 | |
end | |
if ARGV[0].nil? | |
puts "Usage: #{$PROGRAM_NAME} hashtagname" | |
exit 1 | |
end | |
sky = Minisky.new('bsky.social', 'config.yml') | |
sky.check_access | |
p sky.post_request('com.atproto.repo.createRecord', { | |
repo: sky.user.did, | |
collection: 'blue.feeds.hashtag.follow', | |
record: { | |
tag: ARGV[0].gsub(/^#/, '') | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment