Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
240 changes: 240 additions & 0 deletions April5/30entries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/6
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:38:47 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/7
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:38:50 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/8
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:38:53 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/9
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:38:55 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/10
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:38:58 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/11
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:01 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/12
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:04 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/13
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:06 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/14
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:09 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/15
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:12 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/16
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:15 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/17
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:18 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/18
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:20 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/19
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:23 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/20
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:26 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/21
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:29 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/22
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:31 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/23
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:34 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/24
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:37 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/25
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:40 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/26
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:42 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/27
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:45 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/28
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:48 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/29
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:51 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/30
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:53 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/31
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:56 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/32
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:39:59 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/33
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:40:02 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/34
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:40:04 GMT

{}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/35
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 02:40:07 GMT

{}
9 changes: 9 additions & 0 deletions April5/30entries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
#this script will create 30 entries
#Adam Mejia
#filename: 30entries.sh
names=(adam bob charlie dave ed frank gil harry ivan jim ken larry moe ned oscar paul quinn rob steve tim uter vince will xander yun zaphod al ben cameron diink)
for name in ${names[@]}
do
http POST http://localhost:5000/students/ name=$name
done
39 changes: 39 additions & 0 deletions April5/test4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 185
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 01:56:16 GMT

{
"students": [
"http://localhost:5000/students/1",
"http://localhost:5000/students/2",
"http://localhost:5000/students/3",
"http://localhost:5000/students/4"
]
}
HTTP/1.0 201 CREATED
Content-Type: application/json
Content-Length: 2
Location: http://localhost:5000/students/5
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 01:56:19 GMT

{}
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 75
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 01:56:22 GMT

{
"name": "Joe Jack",
"self_url": "http://localhost:5000/students/2"
}
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 2
Server: Werkzeug/0.9.6 Python/2.7.3
Date: Tue, 28 Apr 2015 01:56:25 GMT

{}
8 changes: 8 additions & 0 deletions April5/test4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
#This script will test the 4 HTTP endpoints
#Adam Mejia
#filename: test4.sh
http GET http://localhost:5000/students/
http POST http://localhost:5000/students/ name="Jim Jon"
http GET http://localhost:5000/students/2
http PUT http://localhost:5000/students/2 name="Joe Jack"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ Most/Least posts by author
Top Site References

**Don't forget to push your github branch on Mondays.

I added a sentence to the end of this file.
1 change: 1 addition & 0 deletions bootstrap/custom-build-api-seed
Submodule custom-build-api-seed added at 2abd18
Empty file added conversion.py
Empty file.
35 changes: 35 additions & 0 deletions conversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
#PULL FIRST LINE OF DATA FILE (HEADERS)
line=$(head -n 1 data.csv)
#PARSE $line INTO ARRAY ${field[*]}
IFS=',' read -a field <<< "$line"
#TRACE TO MAKE SURE FIELDS ARE PARSED INTO ARRAY
#for element in "${field[@]}"; do
# echo "$element"
#done
#THIS IS THE FORMAT FOR GETTING LENGTH OF ARRAY echo ${#field[@]}
#CREATE JSON DATA FILE
touch jsondata.json
#BEGIN PIPING DATA INTO JSON FILE > OVERWRITES >> APPENDS
printf "[\n" > jsondata.json
for ((i=2; i <= 1827 ; i++))
do
row=$(sed ""$i"q;d" data.csv)
printf "{\n" >> jsondata.json
IFS=',' read -a entry <<< "$row"
for ((j=0; j <= 20 ; j++))
do
printf "\"" >> jsondata.json
printf "${field[$j]}" >> jsondata.json
printf "\":\"" >> jsondata.json
printf '${entry["$j"]}' >> jsondata.json
printf "\",\n" >> jsondata.json
done
printf "\"" >> jsondata.json
printf "${field[21]}" >> jsondata.json
printf "\":\"" >> jsondata.json
printf "${entry[21]}" >> jsondata.json
printf "\"\n}," >> jsondata.json
done
printf "]"
exit
Loading