![]() |
Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
Hi!
I would like to create a application to store and manage my N900 / N9(50) bookmarks in "the cloud" - to be exact: at google bookmarks! ;) Sadly there is no API and I've already searched for a good alterative, without success. :( I would like to give google a second try. Because of the missing API and hence the missing OAuth I have to act like a webbrowser and after faking a logging in provide the stored cookies to let google believe I'm logged in into their website correctly. I looked into the code from gmarks for android to have a working example how to do it: Here is the login part - Have a look here if you like to see the whole source: BookmarksQueryService.java (Link to github) Code:
public void login( String user, String passwd ) { I tried now to rebuild the same mechanism in Qt: (I shortened the code a little bit and removed the unessential parts) .h Code:
#include <QtNetwork/QNetworkAccessManager> init: Code:
galx = ""; Code:
My code seems to doesn't provide the previously generated cookie to the website. I don't understand why. It is perhaps only a small mistake, a flag not set? The cookies are definitively generated and stored in the CookieJar. Has anybody here some kind of experience with QNetworkAccessManager and cookies? Please help! Any kind of hint is very welcome. :) |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
It's heavily advised to only use one QNetworkAccessManager.
It doesn't look like you've encoded the query, maybe you could try that. I'll give it a better look when I can get to my laptop. |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
Quote:
I will change my code now to use only a single QNetworkAccessManager. Thanks! :) Quote:
|
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
Time for bed now, I guess I'm working now to many hours on this login problem. A break will always be a good idea or I'm afraid google will lock my account - "suspicion of a account hacking attack" ;)
Quote:
Quote:
Quote:
|
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
You may find it quite PITA, due to google changing their logging method quite frequently. They do it, because they like break programs like gMail Drive (sometimes, new version of Gmail drive, just changing logging mechanism arrive every few weeks), so your application may be affected also.
I tried to check if Gmail Drive is Open source (so you could examine login method they use), but unfortunately, license isn't stated anywhere, and it's being released as binaries, so probably it's freeware closed source. Still, I've heard of phpGmailDrive for GNU (tool working just like gmail drive, but linking many accounts into one virtual big account) - You may want to search for it, it may be Open Source. Hope it helps and is at least relevant to Your troubles ;) /Estel |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
Quote:
I'm really afraid of the login problem at google. It is not official and as soon as google change their login method my whole work was for nothing. :( I read google is using the same webservice to sync and store the bookmarks from their chromebook to "the cloud". Do you know something about this? If I had the skills I would build such kind of website myself. It shouldn't be to hard. 3 Tables in a database, "user, bookmarks and a assistance table for a tag cloud"... [sigh] Quote:
I found the relevant parts in the source (search for "GM_LNK_LOGIN"), but php is very different compared to C++ and java... from my current point of view it wont help me. It uses the same links to login. But what I find surprisingling good are the release dates of the files: the most files are from 2005 and the last release 2007. So, if this application still works google doesn't change the login method that often... [finger crossing] :rolleyes: Have you used this application yourself? |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
I 100% agree with You, about currently existing bookmark services. The "social" things like ranking, who got more bookmarks sounds especially pathetic and ridiculous...
Unfortunately, I have no clue about chromebook (don't use anything chrome related, and don't plan to). I also haven't used phpGmailDrive - I used GmailDrive (basic) some time ago, and I remember downloading new version every time I tried to upload/download my files, because old version was already non-working :p I used it as some kind of p2m, to share my bootlegs video recordings. Unfortunately, You're talking to non-coder here (although I'm very interested in coding, and hope to get any skills sooner or later...), so, probably, You're much more skilled than me. --- As I said, I'm not coder, so i may be wrong, but it seems to me, that most time-effective thing You could do, is trying to write some small, but useful "bookmark site" - Honestly, I would use that myself. Even, if it ends up very niche, it seems more stable for future, than relying on non-standardized google bookmarks login. At least, there is no risk, that your work will be "wasted", when google change something. I agree, that writing Your own service for bookmarks may be more work (if You have not experience with it, otherwise, I agree that it should be simple), but You're 100% sure it's not going to be wiped out by other company decisions. Sorry, for not being very helpful here /Estel |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
Quote:
And Google Bookmarks is still in a Beta stage. :mad: Oh well... who knows if google wouldn't shut it down in several weeks like they do with google notes at the moment. [own website] Quote:
Sadly I would need to learn to much other stuff before I would be able to setup such a site... and I'm not sure about the legal requirements. What if someone has patented the idea of a site for bookmarks? |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
You can't patent such idea - you can patent certain way to achieve it (i.e. certain security methods, etc). Anyway, thankfully, there are many Open (licensed following terms of Open Software = can't be patented by some sh|t company) methods, that can be used without fear of patents. MySQL, PHP, just to name few.
Still, honestly, I understand that You're not willing to start such a project. It's quite a huge task, and Your starting idea was to write Open Application for using external possibilities, not creating new ones. On the other hand, many great projects with many people involved, started as small ideas or quasi-unrelated projects... ;) /Estel |
Re: Qt: fake the behavior of a webbrowser during logging in into Google (QNetworkAccessManager and Cookies)
Quote:
I'm sure, the revenue would be to small... but I guess I have to think about this quite a little bit. This sounds to huge for me at the moment. Perhaps I have a different idea. Don't know at the moment... :( |
All times are GMT. The time now is 07:19. |
vBulletin® Version 3.8.8