Skip to content

Instantly share code, notes, and snippets.

@wkentdag
Created May 6, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkentdag/fa95151af79a7daaea7c to your computer and use it in GitHub Desktop.
Save wkentdag/fa95151af79a7daaea7c to your computer and use it in GitHub Desktop.
populating db in production mode
# Make a user
curl -X POST 'http://localhost:3000/users' -d 'first_name=Will&last_name=Test&phone=123456789'
# Make a status
curl -X POST 'http://localhost:3000/status' -d 'owner_id=1&longitude=100&latitude=100&duration=30'
# the above fields are all required. to add viewing permissions to users OTHER than the owner, add:
'&selectedFriends[]=2&selectedFriends[]=5' # etc
# and to add a 160char-max message, add:
'&message="hey there im awesome"'
# Issue a follow request (request access to view another user's statuses)
curl -X POST 'http://localhost:3000/requests' -d 'requested_id=11&user_id=37'
#result: {"result":"User 37 has requested 11"}
# Approve a follow request (grant another user access to view your statuses)
#id = user granting approval; #id2 = user requesting approval
curl -X POST 'http://localhost:3000/users/:id/friends' -d 'friend_id=:id2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment