Skip to content

Commit

Permalink
fix compilation for Opa 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Ye committed Aug 29, 2012
1 parent 1f87ee5 commit d395e30
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/search.opa
@@ -1,7 +1,5 @@

import stdlib.web.client
import stdlib.core.xhtml
import stdlib.core.xmlm

type item = { option(string) title, option(string) link, option(string) guid, option(string) description, option(string) pubDate }

Expand Down Expand Up @@ -111,7 +109,7 @@ Please re-run your application with: --blekko-config option")
(xhtml) match (WebClient.Get.try_get(uri)) {
case {failure:f}: <>"{f}"</>;
case {success:result}:
match (Xmlm.try_parse(result.content)) {
match (Xmlns.try_parse(result.content)) {
case {some:xmlm}:
match (dig(xmlm)) {
case {success:(title,items)}: format_items(title,items);
Expand Down Expand Up @@ -167,7 +165,7 @@ Please re-run your application with: --blekko-config option")

function get_text(option(xml('a,'b)) xml_) {
match (xml_) {
case {some:{args:_, content:[{~text}], namespace:_, specific_attributes:_, tag:_}}: {some:text};
case {some:{args:_, content:[{~text}], ...}}: {some:text};
default: none;
}
}
Expand All @@ -190,7 +188,7 @@ Please re-run your application with: --blekko-config option")
case {~content_unsafe}: {failure:content_unsafe};
case {fragment:_}: {failure:"fragment"};
case {xml_dialect:_}: {failure:"xml_dialect"};
case {args:_, ~content, namespace:_, specific_attributes:_, tag:"rss"}:
case {~content, tag:"rss", ...}:
match (get_content(single_tag("channel",content))) {
case {some:content}:
title = get_text(single_tag("title",content));
Expand Down Expand Up @@ -222,7 +220,7 @@ Please re-run your application with: --blekko-config option")
function get_item(xml('a,'b) xml_) {
//jlog("xml_:{xml_}");
match (xml_) {
case {args:_,~content, namespace:_, specific_attributes:_, tag:"item"}:
case {~content, tag:"item", ...}:
title = get_text(single_tag("title",content))
link = get_text(single_tag("link",content))
guid = get_text(single_tag("guid",content))
Expand Down

0 comments on commit d395e30

Please sign in to comment.