facebookstatus 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/facebookstatus.gemspec +26 -0
- data/lib/.DS_Store +0 -0
- data/lib/facebookstatus.rb +56 -0
- data/lib/facebookstatus/.DS_Store +0 -0
- data/lib/facebookstatus/version.rb +3 -0
- metadata +78 -0
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use default@facebookstatus
|
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "facebookstatus/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "facebookstatus"
|
7
|
+
s.version = Facebookstatus::VERSION
|
8
|
+
s.authors = ["shabbirv"]
|
9
|
+
s.email = ["shabbirv@gmail.com"]
|
10
|
+
s.homepage = "http://shabz.co"
|
11
|
+
s.summary = %q{Facebook status is a Siri plugin.}
|
12
|
+
s.description = %q{This is a plugin that allows you to post to your Facebook wall using Siri.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "facebookstatus"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
# s.add_development_dependency "rspec"
|
23
|
+
# s.add_runtime_dependency "rest-client"
|
24
|
+
s.add_runtime_dependency "json"
|
25
|
+
s.add_runtime_dependency "httparty"
|
26
|
+
end
|
data/lib/.DS_Store
ADDED
Binary file
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "facebookstatus/version"
|
2
|
+
require 'cora'
|
3
|
+
require 'siri_objects'
|
4
|
+
require 'httparty'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
class SiriProxy::Plugin::Facebook < SiriProxy::Plugin
|
8
|
+
attr_accessor :access_token
|
9
|
+
attr_accessor :username
|
10
|
+
|
11
|
+
def initialize(config)
|
12
|
+
self.access_token = config["access_token"]
|
13
|
+
self.username = config["username"]
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
listen_for /facebook status (.+)/i do |facebookText|
|
18
|
+
say "Here is your status:"
|
19
|
+
|
20
|
+
# Preview of the Status update
|
21
|
+
object = SiriAddViews.new
|
22
|
+
object.make_root(last_ref_id)
|
23
|
+
answer = SiriAnswer.new("Facebook Status", [
|
24
|
+
SiriAnswerLine.new('logo','http://cl.ly/CXNm/Screen%20Shot%202011-12-11%20at%2011.26.52%20AM.png'), # facebook logo
|
25
|
+
SiriAnswerLine.new(facebookText)
|
26
|
+
])
|
27
|
+
object.views << SiriAnswerSnippet.new([answer])
|
28
|
+
send_object object
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
if confirm "Ready to send it?"
|
33
|
+
say "Posting to Facebook..."
|
34
|
+
Thread.new {
|
35
|
+
begin
|
36
|
+
page = HTTParty.post(
|
37
|
+
"https://graph.facebook.com/me/feed",
|
38
|
+
:query => {
|
39
|
+
:message => (facebookText),
|
40
|
+
:access_token => (access_token)
|
41
|
+
}
|
42
|
+
)
|
43
|
+
say "Your status has been updated."
|
44
|
+
rescue Exception
|
45
|
+
pp $!
|
46
|
+
say "Sorry, I encountered an error: #{$!}"
|
47
|
+
ensure
|
48
|
+
request_completed
|
49
|
+
end
|
50
|
+
}
|
51
|
+
else
|
52
|
+
say "Ok I won't send it."
|
53
|
+
request_completed
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: facebookstatus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- shabbirv
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-12-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: json
|
16
|
+
requirement: &70262250859240 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70262250859240
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: httparty
|
27
|
+
requirement: &70262250858740 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70262250858740
|
36
|
+
description: This is a plugin that allows you to post to your Facebook wall using
|
37
|
+
Siri.
|
38
|
+
email:
|
39
|
+
- shabbirv@gmail.com
|
40
|
+
executables: []
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- .DS_Store
|
45
|
+
- .gitignore
|
46
|
+
- .rvmrc
|
47
|
+
- Gemfile
|
48
|
+
- Rakefile
|
49
|
+
- facebookstatus.gemspec
|
50
|
+
- lib/.DS_Store
|
51
|
+
- lib/facebookstatus.rb
|
52
|
+
- lib/facebookstatus/.DS_Store
|
53
|
+
- lib/facebookstatus/version.rb
|
54
|
+
homepage: http://shabz.co
|
55
|
+
licenses: []
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options: []
|
58
|
+
require_paths:
|
59
|
+
- lib
|
60
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
requirements: []
|
73
|
+
rubyforge_project: facebookstatus
|
74
|
+
rubygems_version: 1.8.10
|
75
|
+
signing_key:
|
76
|
+
specification_version: 3
|
77
|
+
summary: Facebook status is a Siri plugin.
|
78
|
+
test_files: []
|