Hello
is there a way of getting the content (the source is just text, no images) from a webpage.
i am updating some numbers on a webpage and want the iphone app to retrieve those number.
suggestions are greatly welcomed.
thanks,
stephan.
Hello
is there a way of getting the content (the source is just text, no images) from a webpage.
i am updating some numbers on a webpage and want the iphone app to retrieve those number.
suggestions are greatly welcomed.
thanks,
stephan.
Guess this would work:
http://forum.openframeworks.cc/t/web-upload/2671/5">web upload]http://forum.openframeworks.cc/t/web-upload/2671/5
I saw this post already. but unfortunately i am to much of a beginner to know how to implement this c code.
maybe someone can post an example project.
thanks a bunch.
i’m not shure if this is what you want or if its correct.
in your testApp.h
NSString *onlineTextYouWantToLoad;
string convertedString;
in your testApp.mm <- dont forget to rename from .cpp to .mm (you are using Objective-C vars
//get the string from url to NSString
onlineTextYouWantToLoad = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"[http://www.google.com"]];](http://www.google.com"]];)
//make it a c++ string
convertedString = [onlineTextYouWantToLoad UTF8String];
works great.
i also had to change main.cpp to main.mm
here my code with printing it to the screen:
ofSetColor(255,255,255);
char Str[1024];
//get the string from url to NSString
onlineTextYouWantToLoad = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"[http://lozano-hemmer.com/stephan/test.html"]];](http://lozano-hemmer.com/stephan/test.html"]];)
//make it a c++ string
convertedString = [onlineTextYouWantToLoad UTF8String];
sprintf(Str, "%s", convertedString.c_str());
verdana.drawString(Str, 15,30);
yes, i forgot to tell you to change also main.cpp.
glad it works for you.
first time i’ve helped someone here, instead of asking for help.