lita-onewheel-unstagram 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f313465016d11bfa97000aa287088196da05265fb7bf9a8aba0847beec8b97c5
4
- data.tar.gz: 882e14db4e0d487e82703e461f84f8dadb486fee463e5a738c4221be763f8250
3
+ metadata.gz: aa53cf75153cf93611ff5161ad749da3cb23544dac303d84de4811f34540b396
4
+ data.tar.gz: 7bdd6960730e4435e2ea6335fb02636a28bcb601a12f891f1d8ee083e12fe91e
5
5
  SHA512:
6
- metadata.gz: 36e13f4e669406258bfc348bf6b3dd0a716624b5f7abae3bd1934776babf74c1184b3ae4d1330b208ac42a112f41a125ea1b5e6ceec3e44136341256c5969c88
7
- data.tar.gz: 361d4ea257cb54485f634292b5c6c476af08433a687db981d2fe95247929fbff683708b744d04e072d4fb622d7ffad4f275d32b4836502bc283e9f7b7ff07b21
6
+ metadata.gz: b9b6c2e23ef220f8ea59ebfde607a9ccc3edb2eade22d06373561c93dc8de6a4594c469021281a6ddd24314ecd995f942e3aa5d34d9e0dc829756bf10e5667ee
7
+ data.tar.gz: '08e6bab1aa41a96f4b884865f1b649ef229673569ed955ea06fabfe950973add2c763203848d8d1a30a22e14b9582a4af03978978c7bbac6f3d4a67cad4d743e'
@@ -3,24 +3,25 @@ require 'rest-client'
3
3
  module Lita
4
4
  module Handlers
5
5
  class OnewheelUnstagram < Handler
6
- route /.*(https:\/\/www.instagram.com\/p\/.*)\?/i, :handle_unstagram
6
+ route /.*(https:\/\/www.instagram.com\/p\/.*\?igshid)/i, :handle_unstagram
7
7
 
8
8
  def handle_unstagram(response)
9
- fetch_url = response.matches[0][0]
9
+ fetch_url = response.matches[0][0].sub /\?igshid.*/, ''
10
+
10
11
  Lita.logger.info("Fetching #{fetch_url}")
11
12
 
12
- resp = RestClient.get(fetch_url, user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0')
13
+ # resp = RestClient.get(fetch_url, user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0')
13
14
  quick_down = fetch_url
14
15
 
15
- if m = /window._sharedData = ({.*})\;/.match(resp)
16
- json = JSON.parse m[1]
17
- Lita.logger.info json['entry_data']
18
- Lita.logger.info json['entry_data']['PostPage']
19
- Lita.logger.info json['entry_data']['PostPage'][0]
20
- Lita.logger.info json['entry_data']['PostPage'][0]['graphql']
21
- Lita.logger.info json['entry_data']['PostPage'][0]['graphql']['shortcode_media']
22
- quick_down += " #{json['entry_data']['PostPage'][0]['graphql']['shortcode_media']['display_url']}"
23
- end
16
+ # if m = /window._sharedData = ({.*})\;/.match(resp)
17
+ # json = JSON.parse m[1]
18
+ # Lita.logger.info json['entry_data']
19
+ # Lita.logger.info json['entry_data']['PostPage']
20
+ # Lita.logger.info json['entry_data']['PostPage'][0]
21
+ # Lita.logger.info json['entry_data']['PostPage'][0]['graphql']
22
+ # Lita.logger.info json['entry_data']['PostPage'][0]['graphql']['shortcode_media']
23
+ # quick_down += " #{json['entry_data']['PostPage'][0]['graphql']['shortcode_media']['display_url']}"
24
+ # end
24
25
 
25
26
  response.reply quick_down
26
27
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-onewheel-unstagram"
3
- spec.version = "0.0.1"
3
+ spec.version = "0.0.2"
4
4
  spec.authors = ["Andrew Kreps"]
5
5
  spec.email = ["andrew.kreps@gmail.com"]
6
6
  spec.description = "Wee li'l instagram dereferencer since... I hate igshids"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-unstagram
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps