Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Qt.io webservices
  4. Qt DevNet Web Service API
QtWS25 Last Chance

Qt DevNet Web Service API

Scheduled Pinned Locked Moved Qt.io webservices
61 Posts 10 Posters 45.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    ZapB
    wrote on last edited by
    #8

    Thanks Gerolf. I have just read both of those and have tried the API (using browser). Now to learn how to use QJson to parse the responses and get a proof of concept example working...

    Nokia Certified Qt Specialist
    Interested in hearing about Qt related work

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #9

      Marius if you happen to read this, is there a way to login to QtDN without scraping the various fields from the login form? Can I just submit a post request using QNAM directly? What fields are required in the post request?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • T Offline
        T Offline
        troubalex
        wrote on last edited by
        #10

        [quote author="ZapB" date="1300203182"]Thanks Gerolf. I have just read both of those and have tried the API (using browser). Now to learn how to use QJson to parse the responses and get a proof of concept example working...[/quote]

        I like the idea. :) I have been toying with the idea of some integration into the "KDE Social Desktop":http://techbase.kde.org/Projects/Social-Desktop resp. into the "Open Collaboration Services":http://www.freedesktop.org/wiki/Specifications/open-collaboration-services as well. It never really materialized though.

        Currently, I am waiting for some proper documentation for the existing API from the developer who wrote it. As soon as I have that I'll make it available on the wiki. Maybe I should nag him a bit...

        If you have suggestions for improvements while you play with the API, please let us know. :)

        THE CAKE IS A LIE
        Web Community Manager - Qt Development Frameworks

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #11

          Thank you for that. I'll look forward to seeing the docs. I've nto made much progress yet as I was offline last week (son's birthday and decorating home office). I'll post back with API extensions that would be useful as I come across them.

          Thanks again!

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on last edited by
            #12

            I have had a couple of hours ot play around with this today. Here is the result of my tinkering so far:
            !http://gallery.theharmers.co.uk/upload/2011/04/09/20110409200932-876ce30f.png(QtDevNet Profile Details)!

            So far my simple test harness just uses QNAM to login to QtDN and then uses the web api described "here":http://bugreports.qt.nokia.com/browse/QTWEBSITE-137 to query my profile details. The main widget is a declarative view in which I have a simple qml scene that binds to properties of a C++ Profile object.

            Could I put in a request for an addition to the profile api please? It would be very useful if it also returned an entry for the total number of points in this rank. That is the total number of points required to go from Robot Herder to Dinosaur Breeder for example. This would allow me to calculate a percentage towards next level value and show that in a progress bar without the need to hard-code the rank point boundaries.

            Next I will start looking at the Unread Forum Posts api and see if I can make another qml component for that. I will also add in support for profile badges. I'll try to find some time tomorrow to make this little code available to anybody who is interested.

            Eventually I would like to release a little QML based QtDevNet app for Symbian etc.

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #13

              Oh another api request...would it be possible to have the url to the profile's avatar image returned in the profile call too please?

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #14

                If anybody is interested, you can now download my little test harness from my subversion repository. Just do:

                @svn co https://svn.theharmers.co.uk/svn/codes/public/qtdevnetclient/trunk qtdevnetclient@

                Then build as normal. This project requires qjson to be available. If the compiler cannot find it then export QJSONROOT with the path to where qjson is installed and re-run qmake.

                The test harness app now polls QtDN every 60 seconds for an update to your profile which is then relfected in the QML scene.

                For now it is just functional. I'll add some bling later ;-)

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mgran
                  wrote on last edited by
                  #15

                  Good stuff, and a QNAM login. You're on a roll ZapB :)

                  [quote author="ZapB" date="1302376861"]Oh another api request...would it be possible to have the url to the profile's avatar image returned in the profile call too please?[/quote]

                  I'll add it to the backlog, no room in the current iteration and filling up fast for the next.

                  Project Manager - Qt Development Frameworks

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #16

                    It was surprisingly easy - only 453 lines of code plus a little QML so far. If I get something useful going then maybe you'll see a new user-agent string showing up in the analytics soon ;-)

                    @request.setRawHeader( "User-Agent", "ZapB's QtDevNet Client 0.1" );@

                    When I finish the next stage I may have some more API requests as that will likely be the much easier option as opposed to scraping fragments from a complete web-page. It will result in a lighter load on the server too.

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      troubalex
                      wrote on last edited by
                      #17

                      Very nice! I like it. :)

                      THE CAKE IS A LIE
                      Web Community Manager - Qt Development Frameworks

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andre
                        wrote on last edited by
                        #18

                        I have so far not been able to compile it yet. QJson is failing to compile at this moment... :-(

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          ZapB
                          wrote on last edited by
                          #19

                          Thank you. I'll keep adding little bits to it and post back again when it is usable for a little more than looking at your own points ;-)

                          @Andre, I am using qjson-0.7.1 which I installed via portage. I have not tried building it by hand.

                          Nokia Certified Qt Specialist
                          Interested in hearing about Qt related work

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            andre
                            wrote on last edited by
                            #20

                            Managed to build qjson (from git), and with some adjustments to your code (in the .pro file and in the include of qjson you use), I even managed to build the app. Trying to run it instantly crashes though, so I'll try for a bit more...

                            1 Reply Last reply
                            0
                            • Z Offline
                              Z Offline
                              ZapB
                              wrote on last edited by
                              #21

                              Impressive! ;-)

                              I've not tried at all on Windows yet. I'll see if I can get it workign there tonight. I do not know of any platform-specific things though. Maybe I forgot to initialise a pointer in a ctor or something.

                              Nokia Certified Qt Specialist
                              Interested in hearing about Qt related work

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                andre
                                wrote on last edited by
                                #22

                                OK, got it working, it was a simple matter of the executable not being able to find the qjson library when running. Now all I have to do is figure out what the app actually does :-)

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  andre
                                  wrote on last edited by
                                  #23

                                  The changes I had to make to make it compile for me:

                                  In qtdevnet.pro, changed the path handling a bit
                                  @
                                  INCLUDEPATH += $$(QJSONROOT)/src
                                  LIBS += -L$$(QJSONROOT)/lib -lqjson
                                  @

                                  In profile.cpp, I changed the include for qjson's parser.h:
                                  @
                                  #include <parser.h>
                                  @

                                  This way, I can actually make QJSONROOT point to where I downloaded and build QJson.

                                  1 Reply Last reply
                                  0
                                  • Z Offline
                                    Z Offline
                                    ZapB
                                    wrote on last edited by
                                    #24

                                    The only thing you can do at present is to go to the "Application->Login..." and enter your QtDevNet credentials (not included support for OpenID yet) and it will login via QNAM (see the Authenticator class). One slight mystery I have not had time to look at yet is why QUrl::toPercentEncoding() will not encode a "/" character. I have to manually replace that with / later. I'll step into the Qt code later and take a look.

                                    If that works it will start a timer inside the Profile class that polls QtDN for your profile stats once every 60 seconds. The response is parsed using qjson and the properties updated accordingly.

                                    The Profile class is exposed to the QML root context and the qml scene just binds to the properties of it (and one property from the autheticator object which determines if the qml items are visible or not).

                                    It's just a starter for 10/proof of concept at this stage. Nothing fancy. Having said that it will be simple to extend to cover other features that could be supported by a web API.

                                    Nokia Certified Qt Specialist
                                    Interested in hearing about Qt related work

                                    1 Reply Last reply
                                    0
                                    • Z Offline
                                      Z Offline
                                      ZapB
                                      wrote on last edited by
                                      #25

                                      Thanks for the mods. I'll patch my source for win support with it.

                                      Edit: I have applied the patch this in svn now.

                                      Nokia Certified Qt Specialist
                                      Interested in hearing about Qt related work

                                      1 Reply Last reply
                                      0
                                      • Z Offline
                                        Z Offline
                                        ZapB
                                        wrote on last edited by
                                        #26

                                        Just a small update. The login dialog is now handled via QML too (the actual network stuff is still in C++ of course). It's in svn if anybody wants to grab the update. Here's a screenie (no bling-tastic animations yet though).

                                        !http://gallery.theharmers.co.uk/upload/2011/04/22/20110422154652-693ce8de.png(QML Login Screen)!

                                        ps I hope you don't mind me grabbing artistic assets from the site for use in this client. ;-)

                                        Nokia Certified Qt Specialist
                                        Interested in hearing about Qt related work

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          mgran
                                          wrote on last edited by
                                          #27

                                          Sweet ZapB, I'll try out the updates once I get back from the Easter break and to a proper pc :)

                                          Project Manager - Qt Development Frameworks

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved