Skip to content

Twitter Practice Application

ramazanarslan edited this page Apr 30, 2018 · 4 revisions

In this practice application, we aimed to maintain a hiStory platform living on Twitter. People can write (mini) stories with a nickname (username) to be published on our Twitter account, @hiStory_g7.

You can reach our application on HERE..

What can People do on This Application?

  • See all the posts (tweets) published on @hiStory_g7.
  • See all the posts (tweets) of @hiStory_g7 that contains a URL.
  • Create a post (tweet) to be published on @hiStory_g7.
  • Search for posts (tweets) of @hiStory_g7 by username (nickname) or tags.

API Endpoints

Other than UI, we have created some API endpoints. You can use our API endpoints to interact with the application. UI parts of the application also use these API endpoints internally. API endpoints use Twitter API to interact with Twitter.

They are as follows:

API#1: Get All Posts (Tweets)

Request

To retrieve all the posts (tweets) published on @hiStory_g7, send a GET request to api/memory_posts/all.json.

Response

Body of the response will be a JSON in the form:

{
  tweet_id: {
              'body' : <full text of the tweet>,
              'created_at' : <time the tweet has been created>
            },
  ...
}

API#2: Get All Posts (Tweets) that Contains URL

Request

To retrieve all the posts (tweets) of @hiStory_g7 that contains a URL, send a GET request to api/memory_posts/geturl.json.

Response

Body of the response will be a JSON in the form:

[<tweet_text>, <tweet_text>, ...]

API#3: Create Post (Tweet)

Request

To create a post (tweet) on @hiStory_g7, send a POST request to api/memory_posts/create.json. Request body should contain a JSON object in the following form:

{
  'story': <A string of story (tweet text)>,
  'username': <nickname of the writer of the story (author)>,
  'tags': <A List of Strings, each string is a Memory Tag>
}

Only tags field can be omitted. When a request is sent to this API point, a tweet will be created on @hiStory_g7 with this format: <story> AUTHOR: <username> #<tag1> #<tag2> ... #<tagN>

Response

Body of the response will be a JSON in the form:

{
  'result': <A String of either 'success' or 'error'>
  'message': <In case of 'success', a String of posted Tweet. In case of 'error', a String of a specific error message>
}

API#4: Search for Posts (Tweets)

Request

To search for posts (tweets) published on @hiStory_g7, send a GET request to api/memory_posts/search.json. Request body should contain a JSON in the following form:

{
  'username': <A String of nickname>,
  'tags': <A List of Strings representing tags for memory post.>
}

Only one field (etiher 'username' or 'tags') should be provided.

Response

Body of the response will be a JSON in the form:

{
  tweet_id: {
              'body' : <full text of the tweet>,
              'created_at' : <time the tweet has been created>
            },
  ...
}

✒️ Assignments

Assignee 👥 Assignment ✔️
Ferhat Melih Dal Setup Amazon Web Service
Ferhat Melih Dal Searching for tweets (UI)
Cemal Burak Aygün Creating new tweets (API)
Serdar Ada Searching for tweets (API)
Enes Koşar Retrieving all the tweets (API)
Cemal Burak Aygün Creating new tweets (UI)
Dilruba Reyyan Displaying all the tweets (UI)
Ramazan Arslan Create basic Django project with initial configurations
Ramazan Arslan Post Including Only Urls(API,UI)
Neval Tüllük Create Main Index Page (UI)
Serdar Ada Create an account on Twitter
Cemal Burak Aygün Create Wiki page for Meeting #9
Clone this wiki locally