Skip to content

Instantly share code, notes, and snippets.

@brianherbert
Created April 10, 2013 05:36
Show Gist options
  • Select an option

  • Save brianherbert/5352078 to your computer and use it in GitHub Desktop.

Select an option

Save brianherbert/5352078 to your computer and use it in GitHub Desktop.
I'm curious how confusing this is. Posts can be associated with a specific map, as if the map owns the post. This post can also be posted to multiple maps. Currently, the owner of the post is listed under "maps" and the maps a post is posted to is under "posts_maps". The reason we don't return the ownership another way is because the post is *ac…
{
"posts": [
{
"externals": [],
"locations": [],
"maps": {
"map_id": 35,
"user_id": 5,
"media_id": 0,
"subdomain": "checkingificancreate",
"name": "",
"description": null,
"avatar": "https://crowdmap.com/assets/img/default-map-avatar.png",
"public": true,
"moderation": "collaborator",
"date_created": 1362113382
},
"media": [],
"post_id": 294,
"users": {
"user_id": 5,
"crowdmap_id": "9cdb2b03a4a21c01e055c497d38e1fb5016f6a4b628b7e18cd503f4620e68bf229d176a14b24a6c175f9e623171fa24190a15db292798c3eecdf3c8bcc2d3a6b",
"crowdmap_id_h": "9896205ca10aa5d49ea40206fd3370ac",
"username": "brianherbert",
"name": "Brian H",
"bio": "Wheaties are good. Nice, we got some of this stuff working.",
"plus": true,
"baselayer": "crowdmap_satellite",
"instagram_auto_post": false,
"date_registered": 1363603014,
"avatar": "//www.gravatar.com/avatar/6c93aba4f1bfc1f5302f4af7c5ecb56d?r=PG&s=200&d=404",
"badges": []
},
"owner_map_id": 35,
"media_id": 0,
"location_id": 0,
"external_id": 0,
"externals_images_id": 0,
"message": "Test affiliation.",
"date_posted": 1365539052,
"public": true,
"permissions": {
"edit": false,
"delete": false
},
"stub": "intl-not-compiled-with-php",
"posts_maps": [
{
"post_id": 294,
"map_id": 0,
"user_id": 0,
"approved": false
}
],
"tags": [],
"posts_likes": [],
"comments": []
}
],
"next": "http://api.crowdmap.new/v1/posts/?limit=1&offset=1",
"curr": "http://api.crowdmap.new/v1/posts/?limit=1",
"prev": "http://api.crowdmap.new/v1/posts/?limit=1&offset=0",
"success": true,
"status": 200,
"timestamp": 1365571971,
"qcount": 8,
"elapsed": "0.543s"
}
@rjmackay
Copy link

trying to understand this..
if a post can have multiple maps, shouldn't 'maps' be an array?
How is the post owner normally identified? is there an owner_id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment