Commits

UENISHI Kota  committed 5a0c2a5

downloading works well.

  • Participants
  • Parent commits d4b470e

Comments (0)

Files changed (1)

 
 exception Bad_tumblr_xml;;
 
-let get_xml url =
-  let s = http_get url in
-  print_string s;
-  flush stdout;;
-
-let get_root_url username = 
-  Printf.sprintf "http://%s.tumblr.com" username;;
-
 let api_url_base username = 
   Printf.sprintf "http://%s.tumblr.com/api/read" username;;
 
-let get_tagged_child node name =
-  let rec pup list = 
-    match list with
-      |[]-> raise Bad_tumblr_xml;
-      |child::remain->
-	 if (Xml.tag child)=name
-	 then child
-	 else pup remain
-  in
-    pup (Xml.children node);;
-
 let get_tagged_and_attr_child node tagname attrname attrvalue=
   let rec pup list = 
     match list with
   let posts_xml = List.nth (Xml.children (Xml.parse_string (http_get url))) 1 in
     List.fold_left get_imgurl [] (Xml.children posts_xml);;
 
-let rec endless username start =
-  (query username start) @ (endless username (start+50));;
+let rec endless list username start =
+  let additional = query username start in
+  endless (list @ additional) username (start+50);;
 
 let rec print_id_urls list = 
   match list with 
 	print_id_urls remain;;
 
 (* print_id_urls (query "kuenishi" 0);; *)
-print_id_urls (endless "kuenishi" 50);;
-
+print_id_urls (endless [] "kuenishi" 50);;
 
 (*
 let rec print_urls list = 
     | url::remain -> 
 	print_endline url;
 	print_urls remain;;
-
-
-  print_endline (api_url_base "kuenishi");;
-  let posts = List.map (Xml.children posts_xml) in
-  print_endline (Xml.tag posts) *)
+*)