diff --git a/app/models/agents/stubhub_agent.rb b/app/models/agents/stubhub_agent.rb index 2c110388..f0ba562b 100644 --- a/app/models/agents/stubhub_agent.rb +++ b/app/models/agents/stubhub_agent.rb @@ -5,13 +5,13 @@ module Agents description <<-MD The StubHub Agent creates an event for a given StubHub Event. - It can be used to track how many tickets are available for the event and the minimum and maximum price. All that is required is that you paste in the url from the actual event, e.g. http://www.stubhub.com/outside-lands-music-festival-tickets/outside-lands-music-festival-3-day-pass-san-francisco-golden-gate-park-polo-fields-8-8-2014-9020701/ + It can be used to track how many tickets are available for the event and the minimum and maximum price. All that is required is that you paste in the url from the actual event, e.g. https://www.stubhub.com/outside-lands-music-festival-tickets/outside-lands-music-festival-3-day-pass-san-francisco-golden-gate-park-polo-fields-8-8-2014-9020701/ MD event_description <<-MD Events looks like this: { - "url": "http://stubhub.com/valid-event-url" + "url": "https://stubhub.com/valid-event-url" "name": "Event Name" "date": "2014-08-01" "max_price": "999.99" @@ -29,7 +29,7 @@ module Agents end def default_options - { 'url' => 'http://stubhub.com/enter-your-event-here' } + { 'url' => 'https://stubhub.com/enter-your-event-here' } end def validate_options @@ -63,7 +63,7 @@ module Agents end def base_url - 'http://www.stubhub.com/listingCatalog/select/?q=' + 'https://www.stubhub.com/listingCatalog/select/?q=' end def build_url diff --git a/app/models/agents/translation_agent.rb b/app/models/agents/translation_agent.rb index ec7ce1cc..515fa39f 100644 --- a/app/models/agents/translation_agent.rb +++ b/app/models/agents/translation_agent.rb @@ -7,7 +7,7 @@ module Agents Services are provided using Microsoft Translator. You can [sign up](https://datamarket.azure.com/dataset/bing/microsofttranslator) and [register your application](https://datamarket.azure.com/developer/applications/register) to get `client_id` and `client_secret` which are required to use this agent. - `to` must be filled with a [translator language code](http://msdn.microsoft.com/en-us/library/hh456380.aspx). + `to` must be filled with a [translator language code](https://msdn.microsoft.com/en-us/library/hh456380.aspx). Specify what you would like to translate in `content` field, you can use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) specify which part of the payload you want to translate. @@ -34,7 +34,7 @@ module Agents end def translate(text, to, access_token) - translate_uri = URI 'http://api.microsofttranslator.com/v2/Ajax.svc/Translate' + translate_uri = URI 'https://api.microsofttranslator.com/v2/Ajax.svc/Translate' params = { 'text' => text, 'to' => to @@ -63,7 +63,7 @@ module Agents auth_uri = URI "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13" response = postform auth_uri, :client_id => interpolated['client_id'], :client_secret => interpolated['client_secret'], - :scope => "http://api.microsofttranslator.com", + :scope => "https://api.microsofttranslator.com", :grant_type => "client_credentials" access_token = JSON.parse(response.body)["access_token"] incoming_events.each do |event| diff --git a/app/models/agents/weather_agent.rb b/app/models/agents/weather_agent.rb index 5764d454..c5ae742f 100644 --- a/app/models/agents/weather_agent.rb +++ b/app/models/agents/weather_agent.rb @@ -18,10 +18,10 @@ module Agents The `location` should be: - * For Wunderground: A US zipcode, or any location that Wunderground supports. To find one, search [wunderground.com](http://wunderground.com) and copy the location part of the URL. For example, a result for San Francisco gives `http://www.wunderground.com/US/CA/San_Francisco.html` and London, England gives `http://www.wunderground.com/q/zmw:00000.1.03772`. The locations in each are `US/CA/San_Francisco` and `zmw:00000.1.03772`, respectively. + * For Wunderground: A US zipcode, or any location that Wunderground supports. To find one, search [wunderground.com](https://wunderground.com) and copy the location part of the URL. For example, a result for San Francisco gives `https://www.wunderground.com/US/CA/San_Francisco.html` and London, England gives `https://www.wunderground.com/q/zmw:00000.1.03772`. The locations in each are `US/CA/San_Francisco` and `zmw:00000.1.03772`, respectively. * For Dark Sky: `location` must be a comma-separated string of co-ordinates (longitude, latitude). For example, San Francisco would be `37.7771,-122.4196`. - You must setup an [API key for Wunderground](http://www.wunderground.com/weather/api/) in order to use this Agent with Wunderground. + You must setup an [API key for Wunderground](https://www.wunderground.com/weather/api/) in order to use this Agent with Wunderground. You must setup an [API key for Dark Sky](https://darksky.net/dev/) in order to use this Agent with Dark Sky. @@ -49,7 +49,7 @@ module Agents }, "conditions": "Rain Showers", "icon": "rain", - "icon_url": "http://icons-ak.wxug.com/i/c/k/rain.gif", + "icon_url": "https://icons-ak.wxug.com/i/c/k/rain.gif", "skyicon": "mostlycloudy", ... } diff --git a/app/models/agents/website_agent.rb b/app/models/agents/website_agent.rb index bbb1a482..0269b5dd 100644 --- a/app/models/agents/website_agent.rb +++ b/app/models/agents/website_agent.rb @@ -47,7 +47,7 @@ module Agents "@_attr_" is the XPath expression to extract the value of an attribute named _attr_ from a node, and `string(.)` gives a string with all the enclosed text nodes concatenated without entity escaping (such as `&`). To extract the innerHTML, use `./node()`; and to extract the outer HTML, use `.`. - You can also use [XPath functions](http://www.w3.org/TR/xpath/#section-String-Functions) like `normalize-space` to strip and squeeze whitespace, `substring-after` to extract part of a text, and `translate` to remove commas from formatted numbers, etc. Instead of passing `string(.)` to these functions, you can just pass `.` like `normalize-space(.)` and `translate(., ',', '')`. + You can also use [XPath functions](https://www.w3.org/TR/xpath/#section-String-Functions) like `normalize-space` to strip and squeeze whitespace, `substring-after` to extract part of a text, and `translate` to remove commas from formatted numbers, etc. Instead of passing `string(.)` to these functions, you can just pass `.` like `normalize-space(.)` and `translate(., ',', '')`. Beware that when parsing an XML document (i.e. `type` is `xml`) using `xpath` expressions, all namespaces are stripped from the document unless the top-level option `use_namespaces` is set to `true`. @@ -141,7 +141,7 @@ module Agents def default_options { 'expected_update_period_in_days' => "2", - 'url' => "http://xkcd.com", + 'url' => "https://xkcd.com", 'type' => "html", 'mode' => "on_change", 'extract' => { diff --git a/spec/models/agents/stubhub_agent_spec.rb b/spec/models/agents/stubhub_agent_spec.rb index 5d1b8991..73945596 100644 --- a/spec/models/agents/stubhub_agent_spec.rb +++ b/spec/models/agents/stubhub_agent_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' describe Agents::StubhubAgent do let(:name) { 'Agent Name' } - let(:url) { 'http://www.stubhub.com/event/name-1-1-2014-12345' } + let(:url) { 'https://www.stubhub.com/event/name-1-1-2014-12345' } let(:parsed_body) { JSON.parse(body)['response']['docs'][0] } let(:valid_params) { { 'url' => parsed_body['url'] } } let(:body) { File.read(Rails.root.join('spec/data_fixtures/stubhub_data.json')) } @@ -20,7 +20,7 @@ describe Agents::StubhubAgent do } } before do - stub_request(:get, "http://www.stubhub.com/listingCatalog/select/?q=%2B%20stubhubDocumentType:event%0D%0A%2B%20event_id:#{stubhub_event_id}%0D%0A&rows=10&start=0&wt=json"). + stub_request(:get, "https://www.stubhub.com/listingCatalog/select/?q=%2B%20stubhubDocumentType:event%0D%0A%2B%20event_id:#{stubhub_event_id}%0D%0A&rows=10&start=0&wt=json"). to_return(:status => 200, :body => body, :headers => {}) @stubhub_agent = described_class.new(name: name, options: valid_params)