How to access a website in QT
-
Yea I know the question is a bit general, but let me begin to get more specific:
I am trying to create a web-client that can access a website like reddit or something and only tell me when there are new posts. (I prefer to avoid anything that requires rss feeds). I just wanted it to alert me when there is an update or a change. Is there a library that I can use that has some of those tools, if so what are they?
-
Qt uses web-kit. So Qt side is only client technology. As you are aware this information need to come from Server and client need to consume this. RSS the way of doing. If any other standard stuff exist from web-server, I'm sure web-kit will support it. If the web-server is in your control, you can have small script which publishes the information in some way. From client side some thing should always running to take this information.
Otherwise client polling and writing some script at web-server is the only way.
-
Hi rgm78. Wellcome to devnet.
For accessing a website and reading RSS you can use "qnetworkaccessmanager":http://qt-project.org/doc/qt-5/qnetworkaccessmanager.html -
So if I wanted to extract any info, it would HAVE to be through rss?
-
No, its not.
-
Okay & sorry qxoz, I saw your post shortly after reading the longer. Thanks for the link great resource! I also wanted to ask, I was looking at the example
QNetworkAccessManager *manager = new QNetworkAccessManager(this); connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*))); manager->get(QNetworkRequest(QUrl("http://qt-project.org")));
I got this as an output:
QObject::connect: No such slot MainWindow::replyFinished(QNetworkReply*)
what exactly is happeneing?