1
<!doctype html>
2
<head>
3
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
4
  <script type="text/javascript">
5
    $.getJSON("http://127.0.0.1:5000/feed", function(data)
6
    {
7
    d = $.makeArray(data);
8
    d.reverse();
9
    str = "";
10
    console.log(d[0]);
11
    $.each(data, function(i, val)
12
    {
13
      if(val['about'] != undefined && val['about'] != 'undefined' && val['author'] != 'undefined' )
14
      str += "<p>\n<b>@" +val['author']+"</b> has narrated <b>"+val['about']+"#"+val['xpath']+"</b> at <b>"+val['blog']+"#"+val['bxpath']+"</b> for <b>"+val['location']+"</b> in <b>"+val['lang']+"</b>\n</p>";
15
    });
16
    $("#feeds").html(str);
17
    });
18
  </script>
19
</head>
20
<body style="text-wrap:normal">
21
    @<input type="text" id="t1" name="author" value="author" /> says <input type="text" id="t2" name="about" value="about" />  <input type="text" id="t3" name="xpath" value="xpath" /> is related to <input type="text" id="t4" name="blog" value="blog" /> <input type="text" id="t5" name="bxpath" value="bxpath" /> <input type="submit" id="post" name="alipi" value="Feed" onclick="postForm();" />
22
<div id="feeds">
23
</div>
24
<script type="text/javascript">
25
   function postForm()
26
  {
27
   console.log("here");
28
  var arr = {};
29
  arr['author'] = $('#t1').val();
30
  arr['about'] = $('#t2').val();
31
  arr['xpath'] = $('#t3').val();
32
  arr['blog'] = $('#t4').val();
33
  arr['bxpath'] = $('#t5').val();
34
  $.post("http://127.0.0.1:5000/feeds/write", arr, function(data)
35
  {
36
  alert("Posted");
37
  });
38
}
39
</script>
40
</body>
41
</html>