Permalink
Browse files

Adds readme, and a web page with some basic help info.

  • Loading branch information...
1 parent 4cc647c commit 82b888daa482c7412bb5f66c842201c6009a7fa5 @aaronpk committed Apr 12, 2011
Showing with 148 additions and 3 deletions.
  1. +98 −0 README.md
  2. +10 −0 assets/styles.css
  3. +37 −0 help.php
  4. +1 −1 include/inc.php
  5. +1 −1 include/templates/header.php
  6. +1 −1 index.php
View
98 README.md
@@ -0,0 +1,98 @@
+GraphThis.me
+============
+
+This project lets you quickly and easily create graphs of arbitrary data. There is no "signup" process, you
+just start sending data via email and your account will be created automatically.
+
+Create a new graph by sending an email to "your-graph@graphthis.me" and a graph will be created with
+the name of whatever you put before the "@" sign. If you send another email there, you'll eventually
+end up seeing a graph of all the data you sent.
+
+You can include the data for the graph in the subject line or in the message body. If you put your data in
+the subject, the message body will be attached to that point in the graph as a "note".
+
+
+Input Formats
+=============
+
+Your graphs can have one or more series. To create a graph with one series, just send a single number like "150".
+
+`150` A simple one-series graph
+
+For multiple series, either send data as a comma-separated list, or you can name the series for convenience. See the examples below.
+
+`15.2, 203992, 34.49` will create a graph with three series. Future emails must send the series data in the same order
+
+`gallons:15.2 odometer:203992 cost:34.49` will also create a graph with three series, and the series will be named
+
+Future emails can then specify the data points in a different order by specifying their names
+`odometer:203992 cost:34.49 gallons:15.2`
+
+
+How to Install
+==============
+* Download this project and set up a new virtual host serving its files
+* Download the Geoloqi "Common PHP" files at https://github.com/geoloqi/Geoloqi-Common-PHP and set your include path to also search in that project's "include" folder
+* Copy include/config.template.php to include/config.php and configure the database settings
+* You might also want to add a Twitter application key and secret in order to sign in via Twitter
+* If you want to accept data via email, you'll need a mail server like postfix configured to pipe emails to *@example.com to the php script
+
+
+Sample Apache Config
+====================
+
+ <VirtualHost *:80>
+ ServerName graphthis.me
+
+ DocumentRoot /web/sites/graphthis.me/www
+ <Directory /web/sites/graphthis.me/www>
+ Options FollowSymLinks
+ AllowOverride All
+ allow from all
+ php_admin_value include_path ".:/web/sites/graphthis.me/www/include:/web/sites/graphthis.me/common/include:/usr/share/pear"
+ </Directory>
+
+ CustomLog /var/log/httpd/graphthis.me-access_log combined
+ ErrorLog /var/log/httpd/graphthis.me-error_log
+ </VirtualHost>
+
+
+License
+=======
+
+Copyright © 2011 by Aaron Parecki
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+Raphael.js
+==========
+This project includes Raphael.js, available under the MIT license.
+
+Copyright © 2008 Dmitry Baranovskiy
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ÒSoftwareÓ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+The software is provided Òas isÓ, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
+
+http://raphaeljs.com/license.html
+
View
10 assets/styles.css
@@ -16,6 +16,16 @@ body, textarea, input {
color:rgb(40,40,40);
}
+#header {
+ margin: 10px;
+ font-size: 18pt;
+ text-align: center;
+}
+#header a {
+ color: black;
+ text-decoration: none;
+}
+
.ui-dialog-title {
text-shadow: none;
}
View
37 help.php
@@ -0,0 +1,37 @@
+<?php
+include('inc.php');
+
+include('templates/header.php');
+
+?>
+
+<div style="text-align: center;">
+
+ <div style="margin-top: 36px;">Send an email to <span style="background-color: #f9f9f9;">your-graph@graphthis.me</span> to get started!</div>
+ <div style="margin-top: 10px; font-size: 9pt; text-align: left; width: 400px; margin: 0 auto;">
+ <p>Your graphs can have one or more series. To create a graph with one series, just send a single number like "150".</p>
+
+ <div style="margin-top: 15px;">A simple one-series graph:
+ <div style="text-align: center;"><code>150</code></div></div>
+
+ <p>For multiple series, either send data as a comma-separated list, or you can name the series for convenience.</p>
+
+ <div style="margin-top: 15px;">A graph with three series. Future emails must send the series data in the same order:
+ <div style="text-align: center;"><code>15.2, 203992, 34.49</code></div></div>
+
+ <div style="margin-top: 15px;">Create a graph with three series, and the series will be named:
+ <div style="text-align: center;"><code>gallons:15.2 odometer:203992 cost:34.49</code></div></div>
+
+ <div style="margin-top: 15px;">Future emails can then specify the data points in a different order by specifying their names:
+ <div style="text-align: center;"><code>odometer:203992 cost:34.49 gallons:15.2</code></div></div>
+
+ </div>
+ <div style="margin-top: 10px; font-size: 9pt;">You can make more graphs by changing the part before the "@" sign.</div>
+
+ <div style="margin-top: 22px; font-size: 10pt;">Tip: Send your weight to <span style="background-color: #f9f9f9;">weight@graphthis.me</span> every couple days to easily graph your weight over time!</div>
+
+</div>
+
+<?php
+
+include('templates/footer.php');
View
2 include/inc.php
@@ -52,7 +52,7 @@
}
// Redirect to the login page if they're not logged in now
- if(($user == FALSE || $user->id == FALSE) && $_SERVER['SCRIPT_NAME'] != '/login.php' && $_SERVER['SCRIPT_NAME'] != '/index.php') {
+ if(($user == FALSE || $user->id == FALSE) && !in_array($_SERVER['SCRIPT_NAME'], array('/login.php', '/index.php', '/help.php'))) {
header('Location: /login');
die();
}
View
2 include/templates/header.php
@@ -45,5 +45,5 @@
}
if($_SERVER['SCRIPT_NAME'] != '/index.php') {
- echo '<div style="margin: 10px; font-size: 18pt; text-align: center;">GraphThis.me</div>';
+ echo '<div id="header"><a href="/">GraphThis.me</a></div>';
}
View
2 index.php
@@ -16,7 +16,7 @@
<div style="margin-top: 36px;">Send an email to <span style="background-color: #f9f9f9;">your-graph@graphthis.me</span> to get started!</div>
<div style="margin-top: 10px; font-size: 9pt;">Try sending an email with "150" in the subject line.</div>
- <div style="margin-top: 10px; font-size: 9pt;">You can make more graphs by changing the part before the "@" sign.</div>
+ <div style="margin-top: 10px; font-size: 9pt;">You can make more graphs by changing the part before the "@" sign. <a href="/help">more help?</a></div>
<div style="margin-top: 40px;">Been here before?</div>
<div style="margin-top: 10px;"><a href="/login"><img src="/assets/images/sign-in-with-twitter-d.png" width="151" height="24" /></a></div>

0 comments on commit 82b888d

Please sign in to comment.