Examples/Qcodo-preferred way to use 3rd-party api's?

thread: 5 messages  |  last: a year ago  |  started: saturday, april 3, 2010, 8:07 pm pdt


#1  |  kingwithin (San Francisco, CA) United States of America
Saturday, April 3, 2010, 8:07 PM PDT

I am using curl to post to third-party web-services and receive a response in XML.

I am wondering if there are features  in Qcodo which will simplify this or examples of how this is done that does any kind of leverage to simplify this process or put it into the best-practice of the framework.

An example call would be to:


https://api.cloudsponge.com/begin_import/desktop_applet.json?service=ADDRESSBOO
K&user_id=myUserId_0003&echo=echo123&domain_key=33664218758c5244136965160db455d
b012b1411&domain_password=Tpa01z+vVPE7MxXi

This would return an XML formatted response.

Thanks.

#2  |  VexedPanda (Calgary, AB) Canada
Tuesday, April 6, 2010, 8:35 AM PDT

I'm not sure about QCodo specifically, but there's a curl plugin for QCubed:
http://examples.qcu.be/assets/plugins/QCurl/example/qcurl.php
http://trac.qcu.be/projects/qcubed/export/829/plugins/QCurl/releases/QCurl_0.2_1.1_2010-03-21.zip

You may also be able to port it to QCodo with relative ease.

#3  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, April 6, 2010, 5:37 PM PDT

I wouldn't think this is specifically a “qcodo-way” type of question... but it's more that (and this is similar in respect to some of the architecture-related questions that you have had in the past) I would recommend staying with an “OO-way” of architecture.

So the answer is -- it depends.  Where does this kind of CURL call lie within the functionality of the overall architecture of your application?  Is it a service that you intend on running application-wide?  If so, then you might want this kind of functionality in QApplication.

Or alternatively, is there something specifically that you are doing with the XML?  e.g. if you are parsing out the values and updating a data class object, then the code would be much better in that particular data class within a method like RefreshFromCloudSponge() or something like that.

Hope that helps.

#4  |  kingwithin (San Francisco, CA) United States of America
Sunday, April 18, 2010, 8:15 AM PDT

Actually, Vexedpanda's response is what I am looking for:  how does the plugin simplify using straight-up curl commands?

What version do I need to upgrade to to support.

On Qcodo, is there anything similar?

#5  |  VexedPanda (Calgary, AB) Canada
Monday, April 19, 2010, 8:37 AM PDT

I've never actually used curl or this plugin, so I don't really know the answers. You can look at the first link for a usage example, and the source code for full details.
QCurl.class.php



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.