KQOAuthRequest* VimeoAuth::createSearchRequest(const QString &searchString) { KQOAuthRequest *xRequest = new KQOAuthRequest(this); if(!authIsNeeded()) { QUrl url(API_BASE); xRequest->initRequest(KQOAuthRequest::AuthorizedRequest, url); KQOAuthParameters params; params.insert("format", "xml"); params.insert("method", "vimeo.videos.search"); params.insert("query", searchString); xRequest->setAdditionalParameters(params); addAuth(xRequest); xRequest->setHttpMethod(KQOAuthRequest::GET); } return xRequest; }
void TwitterAPI::foo() { qDebug() << "Fo!"; KQOAuthRequest *request = new KQOAuthRequest; request->initRequest(KQOAuthRequest::AuthorizedRequest, QUrl("http://api.twitter.com/1/statuses/public_timeline.xml")); request->setHttpMethod(KQOAuthRequest::GET); request->setConsumerKey(this->ConsumerKey); request->setConsumerSecretKey(this->ConsumerSecret); request->setToken(oauthSettings.value("oauth_token").toString()); request->setTokenSecret(oauthSettings.value("oauth_token_secret").toString()); oauthManager->executeRequest(request); // qDebug() << "foo"; // TwitterRequest *request = new TwitterRequest(TwitterRequest::PublicTimelineUrl, this->oauthManager); // request->execute(); //TwitterRequest *request = new TwitterRequest(Request::Timeline); }
void TwitterAPI::singleTweet() { qDebug() << "singleTweet() invoked..."; KQOAuthRequest *request = new KQOAuthRequest; request->initRequest(KQOAuthRequest::AuthorizedRequest, QUrl(QString(TwitterUrl::SingleTweet).arg("20633898539028480")) ); request->setHttpMethod(KQOAuthRequest::GET); request->setConsumerKey(this->ConsumerKey); request->setConsumerSecretKey(this->ConsumerSecret); request->setToken(oauthSettings.value("oauth_token").toString()); request->setTokenSecret(oauthSettings.value("oauth_token_secret").toString()); // QHash<QNetworkRequest::Attribute, QVariant> myCustomData; // myCustomData.insert(TwitterAPI::ActionAttr, QVariant("stibi rulez :)")); // myCustomData.insert((QNetworkRequest::Attribute) (QNetworkRequest::User+2), QVariant("foo")); // request->setCustomData(myCustomData); // oauthManager->executeRequest(request); }
void LoginManager::getScore(int nid) { //qDebug() << "getScore"; if (_accessToken.isEmpty() || _accessTokenSecret.isEmpty()) { emit getScoreError("getScore - No token"); return; } KQOAuthRequest * oauthRequest = new KQOAuthRequest(); oauthRequest->initRequest(KQOAuthRequest::AuthorizedRequest, QUrl(QString("https://api.musescore.com/services/rest/score/%1.json").arg(nid))); oauthRequest->setHttpMethod(KQOAuthRequest::GET); oauthRequest->setConsumerKey(_consumerKey); oauthRequest->setConsumerSecretKey(_consumerSecret); oauthRequest->setToken(_accessToken); oauthRequest->setTokenSecret(_accessTokenSecret); connect(_oauthManager, SIGNAL(requestReady(QByteArray)), this, SLOT(onGetScoreRequestReady(QByteArray))); _oauthManager->executeRequest(oauthRequest); }