maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Annnounce] Sociality | Facebook client in Qt (https://talk.maemo.org/showthread.php?t=72842)

MohammadAG 2011-05-22 11:48

Re: [Annnounce] Sociality | Facebook client in Qt
 
Why do you keep reinstalling it? The postinst clears the configuraton.

MohammadAG 2011-05-22 13:15

Re: [Annnounce] Sociality | Facebook client in Qt
 
marxian, any ideas on how to get the cookie (then pass it)?, I've looked at cutetube and it doesn't seem to be doing that.

Flashhh 2011-05-22 13:17

Re: [Annnounce] Sociality | Facebook client in Qt
 
I never reinstalled it and i have to type in every single time the login info too :S And now its stopped working via 3g. Only the white page loads, the email and password field not... via wifi it works correctly...

allwise 2011-05-22 13:55

Re: [Annnounce] Sociality | Facebook client in Qt
 
Quote:

Originally Posted by MohammadAG (Post 1012333)
Push notifications won't be implemented anytime soon (I'll be honest, I have no idea how to implement them), but with auto-refresh, the UI will notify you about new items (with an auto refresh rate of 5 minutes, that's enough methinks :p)

http://i56.tinypic.com/m8fqfa.jpg

Vibration and LED are also supported (and configurable)

Edit: oh and I'm stuck on getting the cookie again :/

Thats awesome Mohammad! Thats enough for me by now! :D Great work!

marxian 2011-05-22 13:57

Re: [Annnounce] Sociality | Facebook client in Qt
 
Quote:

Originally Posted by MohammadAG (Post 1012638)
marxian, any ideas on how to get the cookie (then pass it)?, I've looked at cutetube and it doesn't seem to be doing that.

As things stand, I have no need to use cookies in cuteTube-QML. Videos play fine using any of the external media players. I'm only guessing that the solution for QMediaPlayer is to pass a YouTube cookie when making the HTTP request to play the video. I can't think of any other reason why it doesn't work. When using QMediaPlayer, the YouTube server must be aware that the origin of the request is different from that when the video webpage was downloaded, but this problem doesn't exist when using other media players. :confused:

However, I was able to get the cookies for the videoUrl:

Code:


void YouTube::getVideoUrl(const QString &videoId) {
    QString playerUrl = "http://www.youtube.com/get_video_info?&video_id=" + videoId + "&el=detailpage&ps=default&eurl=&gl=US&hl=en";
    QNetworkAccessManager *manager = new QNetworkAccessManager(this);
    QNetworkRequest request;
    request.setUrl(QUrl(playerUrl));
    connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(parseVideoPage(QNetworkReply*)));
    manager->get(request);
}

void YouTube::parseVideoPage(QNetworkReply *reply) {
    QNetworkAccessManager *manager = qobject_cast<QNetworkAccessManager*>(sender());
    qDebug() << manager->cookieJar()->cookiesForUrl(reply->request().url());

...

This last line returned

Code:


(QNetworkCookie("use_hitbox=72c46ff6cbcdb7c5585c36411b6b334edAEAAAAw; domain=.youtube.com; path=/") ,  QNetworkCookie("VISITOR_INFO1_LIVE=-DzhOBbT2vs; expires=Tue, 17-Jan-2012 13:49:30 GMT; domain=.youtube.com; path=/") ,  QNetworkCookie("GEO=a2731021266fb55d211af8f75b6cb61fcwsAAAAzR0JShPI6TdkUag==; domain=.youtube.com; path=/") ,  QNetworkCookie("s_gl=18f5cd48020458e865a469a7155238dacwIAAABVUw==; domain=.youtube.com; path=/") )

So, hopefully you can just pass this list of cookies to the QNetworkRequest used by QMediaPlayer (maybe emit the cookie list along with the url as part of the gotVideoUrl() signal).

I will have a little play around and see if I can get it to work. :)

EDIT: No need to set the cookie jar to a new instance of QNetworkCookieJar. The constructor of QNetworkAccessManager must do this already. :)

MohammadAG 2011-05-22 17:06

Re: [Annnounce] Sociality | Facebook client in Qt
 
Not much luck here, anything on your side?

Also in the next update (Qt Mobility 1.2 APIs are actually neat)
http://i.imgur.com/jlDSk.png

shanttu 2011-05-22 18:30

Re: [Annnounce] Sociality | Facebook client in Qt
 
Quote:

Originally Posted by MohammadAG (Post 1012567)
Why do you keep reinstalling it? The postinst clears the configuraton.

In a hope that the .config file would be created. Right now it does not exist.

marxian 2011-05-22 18:31

Re: [Annnounce] Sociality | Facebook client in Qt
 
No, I still get the forbidden response. :(

geojoking 2011-05-22 18:49

Re: [Annnounce] Sociality | Facebook client in Qt
 
I'd like to submit a proposition:

In Places, when I want to tag friends with me for a check in, could you maybe remove the profile picture?

It really makes the list lag a bit (until all friends load), not to mention it consumes a lot of traffic (aprox 2MB, which is a lot, at least for me, I'm on a 200MB/month limited traffic plan).

MohammadAG 2011-05-22 19:17

Re: [Annnounce] Sociality | Facebook client in Qt
 
Done, I should also work on caching images based on filename...


All times are GMT. The time now is 15:08.

vBulletin® Version 3.8.8