tracemap / tracemap-backend

The Tools Backend
4 stars 1 forks source link

write flask api #5

Closed Eik-S closed 6 years ago

Eik-S commented 6 years ago

get_retweeters( post_id: string) #from twitterApi

{ "response": [
    "<userId>",
    "<userId>"] }
  ]
}

get_followers( user_ids: string) #from neo4j

{ "response": {
    "<userId>":
      ["<userId>","<userId>"],
    "<userId>":
      ["<userId>","<userId>"] 
  }
}

get_user_info( user_id: string) #from neo4j or twitterApi

{ "response": {
    "<userId>": {
        "timestamp": 123,
        "name": "<userName>",
        "screen_name": "<screen_name",
        "location": "<location>",
        "lang":"<language>",
        "followers_count": 123,
        "friends_count": 123,
        "statuses_count": 123,
        "created_at":"<timeString>",
        "profile_image_url": "<url>"
    },
    "<userId>": {
        "timestamp": 123,
        "name": "<userName>",
        "screen_name": "<screen_name",
        "location": "<location>",
        "lang":"<language>",
        "followers_count": 123,
        "friends_count": 123,
        "statuses_count": 123,
        "created_at":"<timeString",
        "profile_image_url": "<url>"
    }
  }
}
Eik-S commented 6 years ago

Folder Structure

Eik-S commented 6 years ago

Some useful resources:

API Authentication:

brunopace commented 6 years ago

There is a line in your code like this:

user_dict[ "profile_img_url"] = str(data['profile_image_url'])

Is there a reason why you changed the property name? should we stick to the same convention Twitter uses not to get confused?