Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Extend problem with HTTP client
  • Loading branch information
RadoRado committed Feb 2, 2016
1 parent dea10fb commit e65e6e0
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions week09/1-Micro-Blog/README.md
Expand Up @@ -6,6 +6,8 @@ The time has come for you to make your first web application for the course.

For this task you will be using [Sinatra](http://www.sinatrarb.com/) to build a **microblogging application**

**Note:** We do not want you to use any database! We want a pure Ruby solution that stores data in memory relying on arrays, hashes, sets and other structures.

## Routes

Your application will have to provide the following interface:
Expand Down Expand Up @@ -43,6 +45,49 @@ Every sequence in a post that begins with `#` and continuous with a valid Ruby i

`get '/search/ruby'` is the interface that we will use for searching for posts tagged with `#ruby`. Present them in the same fashion you present the posts on the index page.

**Note:** We do not want you to use any database! We want a pure Ruby solution that stores data in memory relying on arrays, hashes, sets and other structures.

GL & HF!

## HTTP Client for communication

Our microblog runs on a HTTP server. In order to create a new post, we need a `form` with `POST` method and action pointing to `/new`

For diversity (and learning) reasons, we are going to create a simple console-based Ruby application, that will serve as a client to our microblog.

Our client should read from some config / settings file where our blog is located as an URL.

After this, we are looking for a similar interface:

```
$ ruby client.rb get all
Displaying all blog posts:
...
```

```
$ ruby client.rb get 42
Displaying blog post with id 42:
...
```

```
$ ruby client.rb get 43
Blog post with id 43 not found.
```

```
$ ruby client.rb delete 42
Blog post with id 42 deleted.
```

```
$ ruby client.rb create blog_post.txt
Creating a new blog post with contents from blog_post.txt
...
Created with id 1337!
```

```
$ ruby client.rb search ruby
Searching for blog posts with #ruby:
...
```

0 comments on commit e65e6e0

Please sign in to comment.