In today's digital landscape, social media platforms have become integral to our personal and professional lives. Meta's Threads, a popular social media platform, provides users with a powerful means of communication and sharing content. To enhance the development experience for Ruby developers, we are thrilled to introduce Threads Client Ruby, a comprehensive library that simplifies the process of creating engaging posts with text, images, links, and replies on Meta's Threads.
π Public repo: Threads Client Ruby
π Key Features and Benefits:
- β Text Threads
- β Threads with Image
- β Threads with Link Attachment
- β Get Post Id From URL
- β Reply to Other Threads
- β Like/Unlike a Thread
- β Follow/Unfollow a User
- β Delete a Post
Getting Started:
To start leveraging the power of Threads Client Ruby for creating captivating posts on Meta's Threads, follow these simple steps:
- Install the Gem: Install the gem by executing the following command in your Ruby environment: gem install threads_client.
gem install threads_client_ruby
Usage:
π Config Threads
Using username and password (first time)
credentials = {
username: "Instagram's username",
password: "Instagram's password"
}
ThreadsClientRuby.config do |config|
config.credentials = credentials
end
Using usertoken and userid (get from here)
credentials = {
usertoken: "token received after login successfull",
userid: "Instagram's user id"
}
ThreadsClientRuby.config do |config|
config.credentials = credentials
end
π‘ TIP: Using usertoken and userid to avoid Theard rate limit and decrease response time.
π€ Get usertoken and userid
userinfo = ThreadsClientRuby.get_userinfo
# {
# :usertoken=> "eyJkc191c2VyX2lkIjoiNTgzOTIyMTY....",
# :userid=>"583922..."
# }
β¨ Text Threads
ThreadsClientRuby.publish(text: 'Hello World!')
β¨ Threads with Image
# Online image path
ThreadsClientRuby.publish(text: 'Hello World!', image: 'https://fastly.picsum.photos/id/654/536/354.jpg?hmac=Nqd_oi3EIiPJBAVPYhIUjaEvKpRqLjhtTHkxPmjjo7M')
# Or with local image path
ThreadsClientRuby.publish(text: 'Hello World!', image: '/Users/local-path/logo.jpg')
β¨ Threads with Link Attachment
ThreadsClientRuby.publish(url: 'https://github.com/dereknguyen269/threads_client_ruby')
β¨ Get Post Id From URL
post_id = ThreadsClientRuby.get_post_id('https://www.threads.net/t/CugF-EjhQ3r')
# => 3143538795635609067
β¨ Reply to Other Threads
ThreadsClientRuby.publish(reply_id: post_id, text: "Reply to #{post_id}")
Conclusion:
Threads Client Ruby provides Ruby developers with a seamless and efficient solution for creating engaging posts on Meta's Threads. With support for text, images, links, and replies, this gem empowers developers to build innovative social media tools, automate posting processes, and enhance user experiences on the platform. Unlock the potential of Meta's Threads and captivate your audience with captivating posts using Threads Client Ruby today.
Top comments (1)
good, I use snapthreads to download videos Threads