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.net to download videos Threads