alexa_remotectl 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/alexa_remotectl.rb +46 -0
- data.tar.gz.sig +0 -0
- metadata +22 -2
- metadata.gz.sig +2 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfe02b279946e6fa20e4615f417bbfa52e8128987b630338ae08d86d3e82374e
|
4
|
+
data.tar.gz: f8be3e2e607a59f7592a36810455ae49383750f1e8755cb7fab28edbf83ba219
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: add9df3f63dc5f001ce55703de6e7b579ce646bf713a40a541843eca6ca6fc752a03209209f15c3cdc714bc5a066477381f2f746e6d0d1608c096e9cfcf35973
|
7
|
+
data.tar.gz: 00a8dc58950293d74b42b924c83e4fadfea64f4a70eff6a42489c0d2b8048deac4e76ede59f4c6da594355a44a9c70c3dfe1a5d0f2ea07ebe8a08582713bd04f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/alexa_remotectl.rb
CHANGED
@@ -7,7 +7,53 @@
|
|
7
7
|
|
8
8
|
require 'net/http'
|
9
9
|
require 'uri'
|
10
|
+
require 'clipboard'
|
10
11
|
|
12
|
+
# Use the CodeWizard with the cURL command you've copied using Developer
|
13
|
+
# tools on Alexa's SPA page (within the web browser).
|
14
|
+
#
|
15
|
+
# note: to find the correct url to convert, try clickin on pause or play to
|
16
|
+
# invoke an AJAX request
|
17
|
+
|
18
|
+
class CodeWizard
|
19
|
+
|
20
|
+
def initialize(s='')
|
21
|
+
|
22
|
+
return 'no curl command found' unless s =~ /curl/
|
23
|
+
|
24
|
+
cookie, serialno, type = parse(s)
|
25
|
+
|
26
|
+
@s =<<EOF
|
27
|
+
require 'alexa_remotectl'
|
28
|
+
|
29
|
+
cookie = '#{cookie}'
|
30
|
+
device = {serialno: '#{serialno}', type: '#{type}'}
|
31
|
+
alexa = AlexaRemoteCtl.new(cookie: cookie, device: device)
|
32
|
+
alexa.pause
|
33
|
+
#alexa.play
|
34
|
+
EOF
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def to_s()
|
39
|
+
Clipboard.copy @s
|
40
|
+
puts 'copied to clipboard'
|
41
|
+
|
42
|
+
@s
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def parse(s)
|
48
|
+
|
49
|
+
serialno = s[/deviceSerialNumber=(\w+)/,1]
|
50
|
+
type = s[/deviceType=(\w+)/,1]
|
51
|
+
cookie = s[/Cookie: ([^']+)/,1]
|
52
|
+
|
53
|
+
[cookie, serialno, type]
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
11
57
|
|
12
58
|
class AlexaRemoteCtl
|
13
59
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexa_remotectl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -36,7 +36,27 @@ cert_chain:
|
|
36
36
|
4kVEcApgAgd+04ctE6uiRn5o
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
date: 2022-05-18 00:00:00.000000000 Z
|
39
|
-
dependencies:
|
39
|
+
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: clipboard
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '1.3'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.3.6
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '1.3'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 1.3.6
|
40
60
|
description:
|
41
61
|
email: digital.robertson@gmail.com
|
42
62
|
executables: []
|
metadata.gz.sig
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�9�O��P���� Y����B�R4�`�Љ�Br��פ0�Lڵ��-�=���Můf�H�'!`۫���x���p����"�$��´�PJ����S�����^����F>���BM�b���ѩ�wy���au§�W�N��k���(���4�)�,�.��}I�����x�M�XI�� �����
|
4
|
-
b�z�Y3n��]�uh
|
5
|
-
&54]@^���r��N�t��"#^1��M��yHp\}����M���>�K�9Y��zT�jF��ʽ�4�
|
1
|
+
u�_&���`TnK�����a��j�%�u�v�j��������N�nm�XW�-���#�F���Ƶ��)-/�_x��
|
2
|
+
�<��X-�;ɺ�p
|