lita-onewheel-twitter-photo 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 749ec34f84947e76555703f16019b5b3c2223d66
4
+ data.tar.gz: 241ca5186d3a892ce387381649fe77b4cc68c2f7
5
+ SHA512:
6
+ metadata.gz: 93249586aaa4268c064f44ff6cfff77f8ea8a6ae92c0377fc57c321f1dc47cd2318dfcd32f49a289c5fdd6b4481d7911310496ff33b65a016e5050a69a351f14
7
+ data.tar.gz: 6e50145448d050ec606bffd94b1be5e1f00fc08656244cbb86d4f1d4a4f0703e2696a345c228501d04efea64d8334b55ac3b0be64b52a34a8f5d3f3f8bfef009
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ lita_config.rb
19
+ .idea
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.4
4
+ - 2.3.0
5
+ script: bundle exec rake
6
+ before_install:
7
+ - gem update --system
8
+ services:
9
+ - redis-server
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # lita-onewheel-twitter-photo
2
+
3
+ [![Build Status](https://travis-ci.org/onewheelskyward/lita-onewheel-twitter-photo.png?branch=master)](https://travis-ci.org/onewheelskyward/lita-onewheel-twitter-photo)
4
+ [![Coverage Status](https://coveralls.io/repos/onewheelskyward/lita-onewheel-twitter-photo/badge.png)](https://coveralls.io/r/onewheelskyward/lita-onewheel-twitter-photo)
5
+
6
+ Display twitter photos when status links are posted.
7
+
8
+ ## Installation
9
+
10
+ Add lita-onewheel-twitter-photo to your Lita instance's Gemfile:
11
+
12
+ ``` ruby
13
+ gem 'lita-onewheel-twitter-photo'
14
+ ```
15
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,12 @@
1
+ require 'lita'
2
+
3
+ Lita.load_locales Dir[File.expand_path(
4
+ File.join('..', '..', 'locales', '*.yml'), __FILE__
5
+ )]
6
+
7
+ require 'lita/handlers/onewheel_twitter_photo'
8
+
9
+ Lita::Handlers::OnewheelTwitterPhoto.template_root File.expand_path(
10
+ File.join('..', '..', 'templates'),
11
+ __FILE__
12
+ )
@@ -0,0 +1,27 @@
1
+ require 'nokogiri'
2
+ require 'rest-client'
3
+
4
+ module Lita
5
+ module Handlers
6
+ class OnewheelTwitterPhoto < Handler
7
+ route /(http.*twitter.com\/.*\/status\/\d+)/i, :get_twitter_photo
8
+
9
+ def get_twitter_photo(response)
10
+ uri = response.matches[0][0]
11
+ doc = RestClient.get uri
12
+ noko_doc = Nokogiri::HTML doc
13
+ noko_doc.xpath('//meta').each do |meta|
14
+ attrs = meta.attributes
15
+ if attrs['property'].to_s == 'og:image'
16
+ image = attrs['content'].to_s
17
+ if /media/.match image
18
+ response.reply image.sub /:large/, ''
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ Lita.register_handler(self)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,28 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = 'lita-onewheel-twitter-photo'
3
+ spec.version = '0.0.0'
4
+ spec.authors = ['Andrew Kreps']
5
+ spec.email = ['andrew.kreps@gmail.com']
6
+ spec.description = %q{Lita interface to post links to twitter photos.}
7
+ spec.summary = %q{See above.}
8
+ spec.homepage = 'https://github.com/onewheelskyward/lita-onewheel-twitter-photo'
9
+ spec.license = 'MIT'
10
+ spec.metadata = { 'lita_plugin_type' => 'handler'}
11
+
12
+ spec.files = `git ls-files`.split($/)
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ['lib']
16
+
17
+ spec.add_runtime_dependency 'lita', '~> 4.7'
18
+ spec.add_runtime_dependency 'rest-client', '~> 1.8'
19
+ spec.add_runtime_dependency 'nokogiri', '~> 1.6'
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ # spec.add_development_dependency 'pry-byebug', '~> 3.1'
23
+ spec.add_development_dependency 'rake', '~> 10.4'
24
+ spec.add_development_dependency 'rack-test', '~> 0.6'
25
+ spec.add_development_dependency 'rspec', '~> 3.0'
26
+ spec.add_development_dependency 'simplecov', '~> 0.10'
27
+ spec.add_development_dependency 'coveralls', '~> 0.8'
28
+ end
@@ -0,0 +1,121 @@
1
+
2
+ <!DOCTYPE html>
3
+ <!--[if IE 8]><html class="lt-ie10 ie8" lang="en" data-scribe-reduced-action-queue="true"><![endif]-->
4
+ <!--[if IE 9]><html class="lt-ie10 ie9" lang="en" data-scribe-reduced-action-queue="true"><![endif]-->
5
+ <!--[if gt IE 9]><!--><html lang="en" data-scribe-reduced-action-queue="true"><!--<![endif]-->
6
+ <head>
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+ <meta charset="utf-8">
15
+
16
+ <noscript><meta http-equiv="refresh" content="0; URL=https://mobile.twitter.com/i/nojs_router?path=%2Fgavinjoyce%2Fstatus%2F691773956144119808"></noscript>
17
+
18
+
19
+
20
+ <script id="bouncer_terminate_iframe" nonce="DNqslWvs8Opo46+6rHxOgQ==">
21
+ if (window.top != window) {
22
+ window.top.postMessage({'bouncer': true, 'event': 'complete'}, '*');
23
+ }
24
+ </script>
25
+ <script id="swift_action_queue" nonce="DNqslWvs8Opo46+6rHxOgQ==">
26
+ (function(){function m(a){a||(a=window.event);if(!a)return!1;a.timestamp=(new Date).getTime();!a.target&&a.srcElement&&(a.target=a.srcElement);if(document.documentElement.getAttribute("data-scribe-reduced-action-queue")){var b=a.target;while(b&&b!=document
27
+ .body){if(b.tagName=="A")return;b=b.parentNode}}r("all",s(a));if(!q(a)){r("direct",a);return!0}document.addEventListener||(a=s(a));a.preventDefault=a.stopPropagation=a.stopImmediatePropagation=function(){};if(i){f.push(a);r("captured",a)}else r("ignored",a
28
+ );return!1}function n($){p();for(var a=0,b;b=f[a];a++){var d=$(b.target),e=d.closest("a")[0];if(b.type=="click"&&e){var g=$.data(e,"events"),i=g&&g.click,j=!e.hostname.match(c)||!e.href.match(/#$/);if(!i&&j){window.location=e.href;continue}}d.trigger($.event
29
+ .fix(b))}window.swiftActionQueue.wasFlushed=!0}function o(){for(var a in j){if(a=="all")continue;var b=j[a];for(var c=0;c<b.length;c++)console.log("actionQueue",u(b[c]))}}function p(){clearTimeout(g);for(var a=0,b;b=e[a];a++)document["on"+b]=null}function q
30
+ (a){if(!a.target)return!1;var b=a.target,e=(b.tagName||"").toLowerCase();if(a.metaKey)return!1;if(a.shiftKey&&e=="a")return!1;if(b.hostname&&!b.hostname.match(c))return!1;if(a.type.match(d)&&w(b))return!1;if(e=="label"){var f=b.getAttribute("for");if(f){var g=
31
+ document.getElementById(f);if(g&&v(g))return!1}else for(var i=0,j;j=b.childNodes[i];i++)if(v(j))return!1}return!0}function r(a,b){b.bucket=a;j[a].push(b)}function s(a){var b={};for(var c in a)b[c]=a[c];return b}function t(a){while(a&&a!=document.body){if(a
32
+ .tagName=="A")return a;a=a.parentNode}}function u(b){var c=[];b.bucket&&c.push("["+b.bucket+"]");c.push(b.type);var d=b.target,e=t(d),f="",g,i,j=b.timestamp&&b.timestamp-a;if(b.type==="click"&&e){g=e.className.trim().replace(/\s+/g,".");i=e.id.trim();f=/[^#]$/
33
+ .test(e.href)?" ("+e.href+")":"";d='"'+e.innerText.replace(/\n+/g," ").trim()+'"'}else{g=d.className.trim().replace(/\s+/g,".");i=d.id.trim();d=d.tagName.toLowerCase();b.keyCode&&(d=String.fromCharCode(b.keyCode)+" : "+d)}c.push(d+f+(i&&"#"+i)+(!i&&g?"."+g
34
+ :""));j&&c.push(j);return c.join(" ")}function v(a){var b=(a.tagName||"").toLowerCase();return b=="input"&&a.getAttribute("type")=="checkbox"}function w(a){var b=(a.tagName||"").toLowerCase();return b=="textarea"||b=="input"&&a.getAttribute("type")=="text"||
35
+ a.getAttribute("contenteditable")=="true"}var a=(new Date).getTime(),b=1e4,c=/^([^\.]+\.)*twitter\.com$/,d=/^key/,e=["click","keydown","keypress","keyup"],f=[],g=null,i=!0,j={captured:[],ignored:[],direct:[],all:[]};for(var k=0,l;l=e[k];k++)document["on"+l
36
+ ]=m;g=setTimeout(function(){i=!1},b);window.swiftActionQueue={buckets:j,flush:n,logActions:o,wasFlushed:!1}})();
37
+ </script>
38
+ <script id="composition_state" nonce="DNqslWvs8Opo46+6rHxOgQ==">
39
+ (function(){function a(a){a.target.setAttribute("data-in-composition","true")}function b(a){a.target.removeAttribute("data-in-composition")}if(document.addEventListener){document.addEventListener("compositionstart",a,!1);document.addEventListener("compositionend"
40
+ ,b,!1)}})();
41
+ </script>
42
+
43
+ <link rel="stylesheet" href="https://abs.twimg.com/a/1453511629/css/t1/twitter_core.bundle.css">
44
+
45
+
46
+ <title>Gavin Joyce on Twitter: &quot;It sounds crazy, but disabling npm&#39;s progress bar yields a 2x npm install speed improvement for me https://t.co/ChXxSepCBK&quot;</title>
47
+
48
+
49
+
50
+ <meta name="msapplication-TileImage" content="//abs.twimg.com/favicons/win8-tile-144.png"/>
51
+ <meta name="msapplication-TileColor" content="#00aced"/>
52
+
53
+
54
+ <link rel="mask-icon" sizes="any" href="https://abs.twimg.com/a/1453511629/img/t1/favicon.svg" color="#55acee">
55
+
56
+ <link href="//abs.twimg.com/favicons/favicon.ico" rel="shortcut icon" type="image/x-icon">
57
+
58
+ <link rel="manifest" href="/manifest.json">
59
+
60
+
61
+ <meta name="swift-page-name" id="swift-page-name" content="permalink">
62
+
63
+ <link rel="canonical" href="https://twitter.com/gavinjoyce/status/691773956144119808">
64
+
65
+
66
+
67
+ <link rel="alternate" type="application/json+oembed" href="https://api.twitter.com/1/statuses/oembed.json?id=691773956144119808" title="Gavin Joyce on Twitter: &quot;It sounds crazy, but disabling npm&#39;s progress bar yields a 2x npm install speed improvement for me https://t.co/ChXxSepCBK&quot;">
68
+ <link rel="alternate" type="text/xml+oembed" href="https://api.twitter.com/1/statuses/oembed.xml?id=691773956144119808" title="Gavin Joyce on Twitter: &quot;It sounds crazy, but disabling npm&#39;s progress bar yields a 2x npm install speed improvement for me https://t.co/ChXxSepCBK&quot;">
69
+
70
+
71
+
72
+
73
+
74
+ <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Twitter">
75
+
76
+ <link rel="stylesheet" href="https://abs.twimg.com/a/1453511629/css/t1/twitter_more_1.bundle.css">
77
+ <link rel="stylesheet" href="https://abs.twimg.com/a/1453511629/css/t1/twitter_more_2.bundle.css">
78
+
79
+ <style id="user-style-onewheelskyward-header-img" class="js-user-style-header-img">
80
+
81
+ body.user-style-onewheelskyward .enhanced-mini-profile .mini-profile .profile-summary {
82
+ background-image: url(https://abs.twimg.com/a/1453511629/img/t1/grey_header_web.jpg);
83
+ }
84
+
85
+ body.user-style-onewheelskyward .wrapper-profile .profile-card.profile-header .profile-header-inner {
86
+ background-image: url(https://abs.twimg.com/a/1453511629/img/t1/grey_header_web.jpg);
87
+ }
88
+
89
+
90
+ body.user-style-onewheelskyward .profile-canopy .bg-img {
91
+ background-image: url(https://abs.twimg.com/a/1453511629/img/t1/grey_header_web_retina.jpg);
92
+ }
93
+
94
+ </style>
95
+
96
+
97
+
98
+ <meta property="og:type" content="article">
99
+ <meta property="og:url" content="https://twitter.com/gavinjoyce/status/691773956144119808">
100
+ <meta property="og:title" content="Gavin Joyce on Twitter">
101
+ <meta property="og:image" content="https://pbs.twimg.com/media/CZmsv0SWYAAaO1N.png:large">
102
+ <meta property="og:image:user_generated" content="true">
103
+ <meta property="og:description" content="“It sounds crazy, but disabling npm&#39;s progress bar yields a 2x npm install speed improvement for me”">
104
+ <meta property="og:site_name" content="Twitter">
105
+ <meta property="fb:app_id" content="2231777543">
106
+ </head>
107
+ <body class="three-col logged-in user-style-gavinjoyce PermalinkPage"
108
+ data-fouc-class-names="swift-loading"
109
+ dir="ltr">
110
+ </body>
111
+ </html>
112
+ <input type="hidden" id="init-data" class="json-data" value="{&quot;permalinkOverlayEnabled&quot;:true,&quot;hasKenburnEffectOnSingleImage&quot;:false,&quot;maxTweetComposeCharacters&quot;:140,&quot;baseFoucClass&quot;:&quot;swift-loading&quot;,&quot;bodyFoucClassNames&quot;:&quot;swift-loading&quot;,&quot;macawSwift&quot;:true,&quot;assetsBasePath&quot;:&quot;https:\/\/abs.twimg.com\/a\/1453511629\/&quot;,&quot;assetVersionKey&quot;:&quot;55069f&quot;,&quot;environment&quot;:&quot;production&quot;,&quot;formAuthenticityToken&quot;:&quot;6eae54bf53e7fe60db73dcb3fccff04dac88745f&quot;,&quot;loggedIn&quot;:true,&quot;screenName&quot;:&quot;onewheelskyward&quot;,&quot;fullName&quot;:&quot;onewheelskyward&quot;,&quot;userId&quot;:&quot;14079333&quot;,&quot;guestId&quot;:&quot;142670166679741574&quot;,&quot;allowAdsPersonalization&quot;:true,&quot;scribeBufferSize&quot;:3,&quot;pageName&quot;:&quot;permalink&quot;,&quot;sectionName&quot;:&quot;permalink&quot;,&quot;scribeParameters&quot;:{&quot;lang&quot;:&quot;en&quot;},&quot;recaptchaApiUrl&quot;:&quot;https:\/\/www.google.com\/recaptcha\/api\/js\/recaptcha_ajax.js&quot;,&quot;internalReferer&quot;:null,&quot;geoEnabled&quot;:true,&quot;typeaheadData&quot;:{&quot;accounts&quot;:{&quot;enabled&quot;:true,&quot;localQueriesEnabled&quot;:true,&quot;remoteQueriesEnabled&quot;:true,&quot;limit&quot;:6},&quot;trendLocations&quot;:{&quot;enabled&quot;:true},&quot;dmConversations&quot;:{&quot;enabled&quot;:true},&quot;savedSearches&quot;:{&quot;enabled&quot;:true,&quot;items&quot;:[]},&quot;dmAccounts&quot;:{&quot;enabled&quot;:true,&quot;localQueriesEnabled&quot;:true,&quot;remoteQueriesEnabled&quot;:true,&quot;onlyDMable&quot;:true},&quot;mediaTagAccounts&quot;:{&quot;enabled&quot;:true,&quot;localQueriesEnabled&quot;:true,&quot;remoteQueriesEnabled&quot;:true,&quot;onlyShowUsersWithCanMediaTag&quot;:false,&quot;currentUserId&quot;:14079333},&quot;selectedUsers&quot;:{&quot;enabled&quot;:true},&quot;prefillUsers&quot;:{&quot;enabled&quot;:true},&quot;topics&quot;:{&quot;enabled&quot;:true,&quot;localQueriesEnabled&quot;:false,&quot;remoteQueriesEnabled&quot;:true,&quot;prefetchLimit&quot;:500,&quot;limit&quot;:4},&quot;concierge&quot;:{&quot;enabled&quot;:false,&quot;localQueriesEnabled&quot;:false,&quot;remoteQueriesEnabled&quot;:false,&quot;prefetchLimit&quot;:500,&quot;limit&quot;:6},&quot;recentSearches&quot;:{&quot;enabled&quot;:true},&quot;hashtags&quot;:{&quot;enabled&quot;:true,&quot;localQueriesEnabled&quot;:false,&quot;remoteQueriesEnabled&quot;:true,&quot;prefetchLimit&quot;:500},&quot;useIndexedDB&quot;:false,&quot;showSearchAccountSocialContext&quot;:true,&quot;showTypeaheadTopicSocialContext&quot;:false,&quot;showDebugInfo&quot;:false,&quot;useThrottle&quot;:true,&quot;accountsOnTop&quot;:false,&quot;remoteDebounceInterval&quot;:300,&quot;remoteThrottleInterval&quot;:300,&quot;tweetContextEnabled&quot;:false,&quot;fullNameMatchingInCompose&quot;:true,&quot;topicsWithFiltersEnabled&quot;:true},&quot;dm&quot;:{&quot;notifications&quot;:true,&quot;participant_max&quot;:50,&quot;video_gif_render&quot;:false,&quot;video_gif_upload&quot;:false,&quot;poll_options&quot;:{&quot;foreground_poll_interval&quot;:3000,&quot;burst_poll_interval&quot;:3000,&quot;burst_poll_duration&quot;:300000,&quot;max_poll_interval&quot;:60000}},&quot;whitelistedVideoUser&quot;:false,&quot;pushStatePageLimit&quot;:500000,&quot;routes&quot;:{&quot;profile&quot;:&quot;\/onewheelskyward&quot;},&quot;pushState&quot;:true,&quot;viewContainer&quot;:&quot;#page-container&quot;,&quot;dragAndDropPhotoUpload&quot;:true,&quot;href&quot;:&quot;\/gavinjoyce\/status\/691773956144119808&quot;,&quot;searchPathWithQuery&quot;:&quot;\/search?q=query&amp;src=typd&quot;,&quot;timelineCardsGallery&quot;:true,&quot;deciders&quot;:{&quot;bulkUnfollowEnabled&quot;:true,&quot;custom_timeline_curation&quot;:false,&quot;disable_profile_popup&quot;:false,&quot;native_notifications&quot;:true,&quot;dm_polling_frequency_in_seconds&quot;:3000,&quot;enable_media_tag_prefetch&quot;:true,&quot;enableMacawNymizerConversionLanding&quot;:false,&quot;geoStructuredLocationEnabled&quot;:true,&quot;hqImageUploads&quot;:false,&quot;largeHeaderImageUpload&quot;:true,&quot;mqImageUploads&quot;:false,&quot;partnerIdSyncEnabled&quot;:true,&quot;photoSruGifLimitMb&quot;:5,&quot;promoted_video_logging_enabled&quot;:true,&quot;pushState&quot;:true,&quot;scribeReducedActionQueue&quot;:true,&quot;useHtml5Webcam&quot;:true,&quot;web_perftown_stats&quot;:true,&quot;web_perftown_ttft&quot;:true,&quot;web_sru_stats&quot;:false,&quot;web_upload_direct&quot;:true,&quot;web_upload_video&quot;:true,&quot;upload_video_size&quot;:500,&quot;internationalShippingEnabled&quot;:true,&quot;useV2EndpointsEnabled&quot;:true,&quot;autoplayMediaInTimeline&quot;:true,&quot;useVmapVariants&quot;:false,&quot;autoplayPreviewPreroll&quot;:true,&quot;moments_lohp_enabled&quot;:true,&quot;overlayPermalink&quot;:false,&quot;momentsExperienceEnabled&quot;:true},&quot;experiments&quot;:{},&quot;toasts_dm&quot;:true,&quot;toasts_spoonbill&quot;:true,&quot;toasts_timeline&quot;:false,&quot;toasts_dm_poll_scale&quot;:60,&quot;uploadDomain&quot;:&quot;upload.twitter.com&quot;,&quot;promptbirdData&quot;:{&quot;promptbirdEnabled&quot;:false,&quot;immediateTriggers&quot;:[&quot;PullToRefresh&quot;,&quot;Navigate&quot;],&quot;format&quot;:null},&quot;freezeDashboard&quot;:false,&quot;deviceEnabled&quot;:true,&quot;hasPushDevice&quot;:true,&quot;smsDeviceVerified&quot;:true,&quot;inResearchGroup&quot;:false,&quot;skipAutoSignupDialog&quot;:false,&quot;shouldReplaceSignupWithLogin&quot;:false,&quot;tweetId&quot;:&quot;691773956144119808&quot;,&quot;profile_id&quot;:8953072,&quot;endpoint&quot;:&quot;\/i\/gavinjoyce\/conversation\/691773956144119808&quot;,&quot;overlayCapable&quot;:false,&quot;finagleTraceId&quot;:&quot;22b8996fc475b33f&quot;,&quot;isThreaded&quot;:true,&quot;autoplay&quot;:false,&quot;inOverlay&quot;:false,&quot;trendsCacheKey&quot;:&quot;d215e40783&quot;,&quot;decider_personalized_trends&quot;:true,&quot;trendsEndpoint&quot;:&quot;\/i\/trends&quot;,&quot;initialState&quot;:{&quot;title&quot;:&quot;Gavin Joyce on Twitter: \&quot;It sounds crazy, but disabling npm&#39;s progress bar yields a 2x npm install speed improvement for me https:\/\/t.co\/ChXxSepCBK\&quot;&quot;,&quot;section&quot;:null,&quot;module&quot;:&quot;app\/pages\/permalink&quot;,&quot;cache_ttl&quot;:300,&quot;body_class_names&quot;:&quot;three-col logged-in user-style-gavinjoyce PermalinkPage&quot;,&quot;doc_class_names&quot;:&quot;route-permalink&quot;,&quot;route_name&quot;:&quot;permalink&quot;,&quot;page_container_class_names&quot;:&quot;AppContent wrapper wrapper-permalink&quot;,&quot;ttft_navigation&quot;:false}}">
113
+
114
+
115
+
116
+ <input type="hidden" class="swift-boot-module" value="app/pages/permalink">
117
+ <input type="hidden" id="swift-module-path" value="https://abs.twimg.com/c/swift/en">
118
+
119
+
120
+ <script src="https://abs.twimg.com/c/swift/en/init.a515d35d0e4f65e02fa863c6b285c6b7084e447a.js" async></script>
121
+
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ def mock_fixture(fixture)
4
+ mock = File.open("spec/fixtures/#{fixture}.html").read
5
+ allow(RestClient).to receive(:get) { mock }
6
+ end
7
+
8
+ describe Lita::Handlers::OnewheelTwitterPhoto, lita_handler: true do
9
+ it 'puts the twitter photo on the response' do
10
+ mock_fixture('sample')
11
+ send_message ('https://twitter.com/th3fallen/status/689501399084855297')
12
+ expect(replies.last).to eq('https://pbs.twimg.com/media/CZmsv0SWYAAaO1N.png')
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+ SimpleCov.formatters = [
4
+ SimpleCov::Formatter::HTMLFormatter,
5
+ Coveralls::SimpleCov::Formatter
6
+ ]
7
+ SimpleCov.start { add_filter '/spec/' }
8
+
9
+ require 'lita-onewheel-twitter-photo'
10
+ require 'lita/rspec'
11
+
12
+ # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
13
+ # was generated with Lita 4, the compatibility mode should be left disabled.
14
+ Lita.version_3_compatibility_mode = false
metadata ADDED
@@ -0,0 +1,185 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lita-onewheel-twitter-photo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Kreps
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lita
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rest-client
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.4'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rack-test
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.6'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.6'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.10'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.10'
125
+ - !ruby/object:Gem::Dependency
126
+ name: coveralls
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.8'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.8'
139
+ description: Lita interface to post links to twitter photos.
140
+ email:
141
+ - andrew.kreps@gmail.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".gitignore"
147
+ - ".travis.yml"
148
+ - Gemfile
149
+ - README.md
150
+ - Rakefile
151
+ - lib/lita-onewheel-twitter-photo.rb
152
+ - lib/lita/handlers/onewheel_twitter_photo.rb
153
+ - lita-onewheel-twitter-photo.gemspec
154
+ - spec/fixtures/sample.html
155
+ - spec/lita/handlers/onewheel_twitter_photo_spec.rb
156
+ - spec/spec_helper.rb
157
+ homepage: https://github.com/onewheelskyward/lita-onewheel-twitter-photo
158
+ licenses:
159
+ - MIT
160
+ metadata:
161
+ lita_plugin_type: handler
162
+ post_install_message:
163
+ rdoc_options: []
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 2.4.5.1
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: See above.
182
+ test_files:
183
+ - spec/fixtures/sample.html
184
+ - spec/lita/handlers/onewheel_twitter_photo_spec.rb
185
+ - spec/spec_helper.rb