jwood/auroraalarm

View on GitHub
app/views/site/index.html.erb

Summary

Maintainability
Test Coverage
<section id="description_and_signup">
  <div id="description">
    AuroraAlarm is a <strong>FREE</strong> service that will notify you via SMS when conditions are optimal for
    viewing the <%= link_to 'Aurora Borealis', 'http://en.wikipedia.org/wiki/Aurora_(astronomy)' %>
    in your area. <span id="us_only"><a href="#">Sorry, but this service is currently available to US residents only.</a></span>
  </div>

  <div id="signup">
    <a name="signup"></a>
    <div id="signup_form">
      <% if @message.present? %>
        <span id="signup_message"><%= @message %></span>
      <% else %>
        <%= render partial: 'signup_form' %>
      <% end %>
    </div>
  </div>
</section>

<section id="details">
  <a name="how_does_it_work"></a>
  <h2>How does it work?</h2>
    <p>
      Every evening, AuroraAlarm checks to see if any <%= link_to 'solar events', 'http://en.wikipedia.org/wiki/Coronal_mass_ejections' %>
      have occurred that could trigger a geomagnetic storm, which can produce an Aurora.  If a solar event
      has occurred, you will receive a text message notifying you of the event, asking if you would
      like to receive a text message during the next few nights if conditions are optimal for viewing
      the Aurora.
    </p>
    <p>
      If you indicate that you would like to be notified, AuroraAlarm will send you a text
      message at night if conditions are optimal for viewing the Aurora in your area.
    </p>
    <p>
      What are optimal conditions?

      <ul>
        <li>Dark. Likely in the hours past midnight.</li>
        <li>A <%= link_to 'Kp index', 'http://en.wikipedia.org/wiki/K-index' %> strong enough to push the Aurora down to your <%= link_to 'geomagnetic latitude', 'http://en.wikipedia.org/wiki/Geomagnetic_latitude' %>.</li>
        <li>Clear skies (cloud coverage 20% or less).</li>
        <% if Aurora::Application.config.consider_moonlight %>
          <li>A dark moon (before the first quarter or after the third quarter).</li>
        <% end %>
      </ul>
    </p>

  <a name="about"></a>
  <h2>About</h2>
  <p>AuroraAlarm was created by and is maintained by <%= link_to 'John Wood', 'http://johnpwood.net' %>.</p>
  <p>
    I have always enjoyed watching the weather and the stars.  However, I'm not much of a night owl, and
    every attempt I've made to stay up late enough to see an Aurora after a solar event has failed, miserably.
    Time and time again I would fall asleep, and wake up to find that the conditions were great for viewing
    an Aurora the night before.
  </p>
  <p>
    I wanted something that would wake me up if there was a possibility of seeing an Aurora.  So, I created
    this service to do just that.
  </p>

  <a name="faq"></a>
  <h2>FAQ</h2>
  <ul id="faq_links">
    <li>
      <%= link_to "What are the costs associated with the service?", "#", class: 'faq_link' %>
      <div>
        <p>
           This service is free to use.  However, it uses SMS (text messaging) to notify you of
           certain events, and expects a reply in certain scenarios.  Your cell phone provider
           may charge you for incoming and outgoing SMS messages.
        </p>
      </div>
    </li>
    <li>
      <%= link_to "Will this service wake me up in the middle of the night?", "#", class: 'faq_link' %>
      <div>
        <p>
          Yes, and that's the point!  The best time for viewing Auroras are in the hours past midnight.
          But, we always ask you after a solar event has occurred if you would like to be woken up
          over the next few days if conditions are optimal for viewing an Aurora.  If it's not
          a good time, you can always decline, and we'll notify you when the next solar event occurs.
        </p>
        <p>
          In addition, we'll only notify you if the conditions are optimal for viewing the Aurora in your area.  If the sky is cloudy, we won't
          wake you.  Sun about to rise?  We won't wake you.  This algorithm is constantly being enhanced to
          reduce the chances of waking you up for no reason.
        </p>
      </div>
    </li>
    <li>
      <%= link_to "If you wake me up, does that mean I'll see the Aurora for sure?", "#", class: 'faq_link' %>
      <div>
        <p>
          Sadly, no.  Ambient light (city lights, etc) prevents many from seeing the Aurora.  And,
          there is no good way that I know of to detect the amount of ambient light for your location.
          So, even if all of the other conditions are perfect, you may still be unable to see the
          Aurora due to the amount of ambient light in your area.
        </p>
      </div>
    </li>
    <li>
      <%= link_to "Why is this service only available to US residents?", "#", id: 'us_only_explanation', class: 'faq_link' %>
      <div id="us_only_explanation_div">
        <p>
          I'm good friends with the folks at <a href="http://www.signalengage.com">Signal</a>, a digital marketing company
          that specializes in SMS, email, and social marketing tools.  Signal is graciously allowing me to use their
          SMS service for free to power AuroraAlarm.  Unfortunately, the SMS aggregator they use only delivers messages
          in the US.
        </p>
        <p>
          If you're aware of an SMS aggregator that I could use for free to deliver SMS messages internationally,
          please drop me a line at <%= mail_to 'john@johnpwood.net', 'john@johnpwood.net' %>.
        </p>
      </div>
    </li>
    <li>
      <%= link_to "How do I cancel this service?", "#", class: 'faq_link' %>
      <div>
        <p>You can cancel the service at any time by texting <strong>STOP</strong> to 839863.</p>
      </div>
    </li>
    <li>
      <%= link_to "How do I update my zipcode?", "#", class: 'faq_link' %>
      <div>
        <p>You can update your zipcode at any time by texting <strong>AURORA</strong> followed by your zipcode to 839863. (ex. AURORA 90210)</p>
      </div>
    </li>
    <li>
      <%= link_to "What do you do with my mobile phone number and location information?", "#", class: 'faq_link' %>
      <div>
        <p>
          We use your location information to determine if conditions are right for viewing the Aurora in your area, and we use your mobile
          phone number to send you a text message when they are.  That's it. We won't sell, trade, exchange, hock, auction, vend, expose,
          or barter any of the information we collect.  We respect your privacy, because we love it when people respect ours.
        </p>
        <p>
          If you decide to cancel the service, all information we have about you is immediately and permanently deleted from our database,
          except for any SMS messages that were sent or received.  All SMS messages are deleted two weeks after they are sent or received, giving
          us time to investigate any issues that may be reported.
        </p>
      </div>
    </li>
    <li>
      <%= link_to "Who do I contact if I have any questions, comments, or concerns?", "#", class: 'faq_link' %>
      <div>
        <p>You can reach me, John Wood, at <%= mail_to 'john@johnpwood.net', 'john@johnpwood.net' %>.</p>
      </div>
    </li>
  </ul>
</section>