Module: ThreadsClientRuby
- Defined in:
- lib/threads_client_ruby.rb,
lib/threads_client_ruby/version.rb
Defined Under Namespace
Modules: Config
Classes: Core, Error
Constant Summary
collapse
- DEFAULT_DEVICE_ID =
"android-#{rand(36**24).to_s(36)}"
- LATEST_ANDROID_APP_VERSION =
'289.0.0.77.109'
- BASE_API_URL =
'https://i.instagram.com/api/v1'
- LOGIN_URL =
BASE_API_URL + '/bloks/apps/com.bloks.www.bloks.caa.login.async.send_login_request/'
- POST_URL =
BASE_API_URL + '/media/configure_text_only_post/'
- POST_WITH_IMAGE_URL =
BASE_API_URL + '/media/configure_text_post_app_feed/'
- DEFAULT_LSD_TOKEN =
'NjppQDEgONsU_1LCzrmp6q'
- VERSION =
"0.1.1"
Class Method Summary
collapse
Class Method Details
.get_post_id_from_url(post_url, options = {}) ⇒ Object
53
54
55
56
57
58
59
60
61
|
# File 'lib/threads_client_ruby.rb', line 53
def self.get_post_id_from_url(post_url, options = {})
uri = URI.parse(post_url)
response = Net::HTTP.get_response(uri)
text = response.body.to_s.gsub(/\s+/, '').gsub(/\n+/, '')
post_id = text.match(/{"post_id":"(.*?)"}/)&.captures&.first
lsd_token = text.match(/"LSD",\[\],{"token":"(\w+)"},\d+\]/)&.captures&.first
post_id
end
|
.publish(options = {}) ⇒ Object
available key for options: