What is the procedure for publishing random ads externally?

Functionality discussions and feature requests

Moderators: hugo, alexandre, rmvanarkel

Post Reply
maqueen
Posts: 34
Joined: Mon Aug 22, 2005 6:57 am

What is the procedure for publishing random ads externally?

Post by maqueen »

Hello all,

Happy New Year! I've think that I saw that this feature was possible?

Mark

hugovanderzee
Posts: 98
Joined: Wed Apr 06, 2005 9:56 am

Post by hugovanderzee »

Hi Paul,

Yes this is possible. We created a webservice in Cyclos that takes arguments and repond with xml messages. It is fairly easy to implement in your website but you will need experience with server site script languages like jsp and php. The information about the module can be found in /cyclos/docs/retreive_ads_module (only 2006 versions)

I copied the documentation below:



Writing your own code to retrieve ads
======================================

To perform search with some parameters, you need to know what are
this parameters:

--->>> Possible parameters:

- pageSize: the number of ads that will be returned, if you don't
provide this value, cyclos use the default configuration

- keywords: the keyword will be search into title and description fields

- type : the trade type field on cyclos search form, two values are
possible
0 -> offer
1 -> demand
If you don't provide a value, will be returned both.

- initialPrice: if you want to search by initial price (you need to
remove the format)
- finalPrice : if you want to search by initial price (you need to
remove the format)

- since : the since field is a search by date, a lot of values are possible
0 -> all dates
1 -> one week
2 -> two week
3 -> three week
4 -> one month
5 -> two month
6 -> three month
7 -> today
8 -> yesterday
9 -> two days
10 -> three days
11 -> four days
12 -> five days
13 -> six days

- area: the area's field on cyclos search form, pass AREA_ID

- category: the category's field on cyclos search form, pass CATEGORY_ID

Cyclos provide a list of Areas and Categories in XML format, you can get
those list:

LIST OF AREAS
-------------
http://cyclosdomain.org/cyclos/do/xmlAreas

<?xml version="1.0" encoding="ISO-8859-1"?>
<areas>
<item>
<id>AREA_ID</id>
<name>AREA_NAME</name>
</item>
</areas>

Note: it's a best practice to cache this list, to prevent a lot of
unnecessary requests


LIST OF CATEGORIES
------------------
http://cyclosdomain.org/cyclos/do/xmlCategories

<?xml version="1.0" encoding="ISO-8859-1"?>
<categories>
<item>
<id>CATEGORY_ID</id>
<name>CATEGORY_NAME</name>
</item>
</categories>

Note: it's a best practice to cache this list, to prevent a lot of
unnecessary requests



FINALLY - GETTING LIST OF ADS
=============================

The external search ads receives the posted form by GET, then, you need
to access this url http://cyclosdomain.org/cyclos/do/xmlAds providing
parameters.

Eg.
http://cyclosdomain.org/cyclos/do/xmlAd ... category=1

Returned list
-------------

<?xml version="1.0" encoding="ISO-8859-1"?>
<ads>
<item>
<id>AD_ID</id>
<title>AD_TITLE</title>
<publication>AD_PUBLICATION_DATE</publication>
<price>AD_PRICE</price>
<description>AD_DESCRIPTION</description>
<category>AD_CATEGORY</category>
<profLevel>AD_PROFESSIONAL_LEVEL</profLevel>
</item>
<noItemsFound><message>IF_NO_ADS_FOUND_THIS_TAG_APPEARS</message></noItemsFound>
</ads>

The thumnail images are in http://cyclosdomain.org/cyclos/pages/images/ads/thumb-{ AD_ID}

And the normal images are in
http://cyclosdomain.org/cyclos/pages/images/ads/{ AD_ID}
Hugo van der Zee
Cyclos development team

Post Reply