Skip to content

Commit

Permalink
Output to stdout and avoid libxml2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
afilmore committed Nov 18, 2012
1 parent 1c87636 commit 1835ac2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
27 changes: 26 additions & 1 deletion src/Application.vala
Expand Up @@ -27,8 +27,32 @@ private static int main (string [] args) {
} catch (Error error) {
}

string buffer = "";
File file = File.new_for_path (HTML_OUTPUT);
try {

if (file.query_exists () == true){

DataInputStream input_stream = new DataInputStream (file.read ());

// Read lines until end of file (null) is reached...
string line;
while ((line = input_stream.read_line (null)) != null) {

buffer += line;
}
}

} catch (Error error) {

print ("Error: %s\n", error.message);
return 1;
}

var doc = Html.Doc.parse_file (HTML_OUTPUT, "utf-8");
//~ var doc = Html.Doc.parse_file (HTML_OUTPUT, "utf-8");
var doc = Html.Doc.read_doc (buffer, "", "utf-8", Xml.ParserOption.RECOVER
| Xml.ParserOption.NOERROR
| Xml.ParserOption.NOWARNING);

if (doc == null)
return 1;
Expand All @@ -50,6 +74,7 @@ private static int main (string [] args) {

string content = get_article_div_text (article_node);
write_content (content);
print ("%s\n", content);

delete doc;

Expand Down
6 changes: 4 additions & 2 deletions vdm-get.geany
Expand Up @@ -17,10 +17,12 @@ long_line_behaviour=2
long_line_column=120

[files]
current_page=1
current_page=3
FILE_NAME_0=398;Make;0;16;1;1;0;%2Fhome%2Fhotnuma%2FBureau%2F.Projets%2Fdefi%2Fsrc%2FMakefile.am;0;4
FILE_NAME_1=444;Vala;0;16;0;1;0;%2Fhome%2Fhotnuma%2FBureau%2F.Projets%2Fdefi%2Fsrc%2FApplication.vala;0;4
FILE_NAME_2=146;Sh;0;16;0;1;0;%2Fhome%2Fhotnuma%2FBureau%2F.Projets%2Fdefi%2Fconfigure.ac;0;4
FILE_NAME_2=211;Sh;0;16;0;1;0;%2Fhome%2Fhotnuma%2FBureau%2F.Projets%2Fdefi%2Fconfigure.ac;0;4
FILE_NAME_3=344;Markdown;0;16;0;1;0;%2Fhome%2Fhotnuma%2FBureau%2F.Projets%2Fdefi%2FREADME.md;0;4
FILE_NAME_4=84;None;0;16;0;1;0;%2Fhome%2Fhotnuma%2Fvdm.txt;0;4

[VTE]
last_dir=/home/hotnuma/Bureau/.Projets/defi
Expand Down

0 comments on commit 1835ac2

Please sign in to comment.