void QueryImages::doWorkSendRequest() { Q_D(QueryImages); // Set the url QUrl url = d->mediawiki.url(); url.addQueryItem("format", "xml"); url.addQueryItem("action", "query"); url.addQueryItem("titles", d->title); url.addQueryItem("prop", "images"); url.addQueryItem("imlimit", d->limit); if (!d->imcontinue.isNull()) { url.addQueryItem("imcontinue", d->imcontinue); } // Set the request QNetworkRequest request(url); request.setRawHeader("User-Agent", d->mediawiki.userAgent().toUtf8()); // Send the request d->reply = d->manager->get(request); connectReply(); connect(d->reply, SIGNAL(finished()), this, SLOT(doWorkProcessReply())); }
/*! \brief Requests Steam App ID list. This downloads all steam apps (games) and their coresponding appid's. This process takes some time and shouldn't be done all the time, it's wise to cache the results. */ void Steam::requestAppIDs() { QUrl url( QL( "http://api.steampowered.com/ISteamApps/GetAppList/v1/" ) ); QNetworkRequest request( url ); QNetworkReply *reply = d->network->get( request ); connectReply( reply ); }
/*! \brief Checks the Steam server status. This method requests a Steam server status check. We send the GET request and wait for the reply. */ void Steam::requestServerOK() { QUrl url( QL( "http://api.steampowered.com/ICSGOServers_730/GetGameServersStatus/v1/" ) ); url.addQueryItem( QL( "key" ), Settings::Instance()->apiKey() ); QNetworkRequest request( url ); QNetworkReply *reply = d->network->get( request ); connectReply( reply ); }
/*! \brief Requests the player count for a steam app. This sends out an API request to steam to ask for the player count for the given \p appID. \param appID The app ID we wish the player count for. */ void Steam::requestPlayerCount( int appID ) { if( appID <= 0 ) return; QUrl url( QL( "http://api.steampowered.com/ISteamUserStats/GetNumberOfCurrentPlayers/v0001/" ) ); url.addQueryItem( QL( "appid" ), QString::number( appID ) ); QNetworkRequest request( url ); QNetworkReply *reply = d->network->get( request ); connectReply( reply ); }
/*! \brief Requests a list of achievements for a steam app. \param appID The app ID we wish to get the achievement list for. */ void Steam::requestAchievementsForGame( int appID ) { if( appID <= 0 ) return; QUrl url( QL( "http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/" ) ); url.addQueryItem( QL( "key" ), Settings::Instance()->apiKey() ); url.addQueryItem( QL( "appid" ), QString::number( appID ) ); QNetworkRequest request( url ); QNetworkReply *reply = d->network->get( request ); connectReply( reply ); }
/*! \brief Request Steam App image. This downloads a graphic resource from a steam URI. Upon success we create a \c QPixmap out of it and send it out to the main window via signal. \param appID The app ID we wish the game image for. */ void Steam::requestAppImage( int appID ) { if( appID <= 0 ) return; QString urlStr( QL( "http://cdn.akamai.steamstatic.com/steam/apps/%1/" "header.jpg" ) ); QUrl url( urlStr.arg( appID ) ); QNetworkRequest request( url ); QNetworkReply *reply = d->network->get( request ); connectReply( reply ); }