Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An elegantly simple todo list

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 chrome_app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 public
Octocat-spinner-32 script
Octocat-spinner-32 test
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
README.md

Fluttrly

Fluttrly is a simple to-do list that allows you and others to add to a todo list for all to see!

Usage

At the home screen, just add your name to the text box and you're ready to start adding to a list.

License

Fluttrly is protected under the AGPL license.

Please see LICENSE for more details.

Author

Lovingly created by Chris Oliver.

API

The Fluttrly API is ridiculously simple. Just append ".json" or ".xml" to the end of the list URL that you would like to retrieve.

JSON

Example: GET Request http://fluttrly.com/test.json

Result: [{"task":{"name":"Example","created_at":"2010-12-19T02:58:06Z","completed":false,"updated_at":"2010-12-19T02:58:06Z","id":446,"content":"And you can easily share from the web"}}, {"task":{"name":"Example","created_at":"2010-12-19T02:57:58Z","completed":true,"updated_at":"2010-12-19T02:58:00Z","id":445,"content":"This is a completed task"}}, {"task":{"name":"Example","created_at":"2010-12-19T02:57:37Z","completed":false,"updated_at":"2010-12-19T02:57:51Z","id":443,"content":"Items can be checked as completed"}}, {"task":{"name":"Example","created_at":"2010-12-19T02:57:22Z","completed":false,"updated_at":"2010-12-19T02:57:22Z","id":440,"content":"Type a new task"}}]

XML

Example: GET Request http://fluttrly.com/test.xml

Result: <?xml version="1.0" encoding="UTF-8"?> Example2010-12-19T02:58:06Zfalse2010-12-19T02:58:06Z446And you can easily share from the webExample2010-12-19T02:57:58Ztrue2010-12-19T02:58:00Z445This is a completed taskExample2010-12-19T02:57:37Zfalse2010-12-19T02:57:51Z443Items can be checked as completedExample2010-12-19T02:57:22Zfalse2010-12-19T02:57:22Z440Type a new task

POST

Posting a new task is easy too! Request a normal page to retrieve the authenticity_token, then you can submit the name of the list the task is for as well as the content of the task.

Example (Python):

#!/usr/bin/env python
# This example assumes you have a copy of Fluttr running on localhost:3000

import cookielib
import re
import urllib, urllib2

# Build the URL opener that saves cookies
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

# Request the test page so that we can get the auth token
f = opener.open("http://localhost:3000/test")
data = f.read()

# Parse out the auth token
auth_token = re.search(r'name="authenticity_token".*value="(.+)"', data).group(1)

# Setup the POST request and encode it
data = {"authenticity_token": auth_token,
        "task[name]": "test",
        "task[content]": "This is a test",
        }
data = urllib.urlencode(data)

# POST!
f = opener.open("http://localhost:3000/tasks.js", data)

# You're done! Now visiting /test will have your new task!

Example (Ruby):

require 'net/http'
require 'uri'

# Initialize our session
url = URI.parse("http://localhost:3000/test")
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }

# Parse out the auth token and get the session cookie
auth_token = $1 if res.body =~ /"authenticity_token".*value="(.+)"/ or nil
cookie = res['set-cookie'].split("; ")[0]

raise "No auth token" if auth_token.nil?

# Setup the params for POST
params = { 
    "task[content]" => "NICE", 
    "task[name]" => "test", 
    "authenticity_token" => auth_token
}

# Create a POST request
url = URI.parse("http://localhost:3000/tasks.js")
req = Net::HTTP::Post.new(url.path)

# Setup parameters
req.add_field("Cookie", cookie)
req.set_form_data(params)

# POST!
res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
Something went wrong with that request. Please try again.