Search the web
Sign In
New User? Sign Up
oodleapi · Oodle API Developers Chat
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Couple of API inquires PHP   Message List  
Reply | Forward Message #295 of 539 |
Re: Couple of API inquires PHP

Hi! Have you already solved this? It's pretty easy to figure out if
you use the documentation at developer.oodle.com, but I made you a
little demo page you can see at crashjoplin.com/xml/oodledemo.php
which will show you only 30 listings with pictures from that date.

Here's the code to produce those results:


<?php
// calls the oodle class available from Oodle
include("oodle_api_php5.php");

//set number of pics to show
$showlimit=30;

//set a number to check. This is higher than
//what we want to show to accommodate for

//listings without pictures. Because we'll
//be ignoring them for this
$startrecord='0';
$endrecord='200';

//Set your date you want to check
$startdate=strtotime('Feb 28 2008');
$enddate=strtotime('Feb 29 2008');

//*************** Settings - Customize them to fit your needs!


$filters['partner_id'] = 'getcherown';
$filters['region'] = 'usa';

// a blank category means "all"
$filters['category']='';
$filters['from'] = $startrecord;
$filters['to'] = $endrecord;
//filter by the dates above
$filters['filters'][] =
array('type'=>'create_time','params'=>array('low' => $startdate,'high'
=> $enddate));

$oodleApi = new OodleApi();
$response=$oodleApi->make_request('get',$filters);

//this loop sorts
//through the results and only shows those with
//pictures, and limits the number shown to 30...of course you can
//change this however you like...

$piccount=0;
foreach ($response['items'] as $key=>$ad) {
$picprinted=false;
foreach($ad as $key=>$val) {
if (($ad['thumb'])and ($ad['create_time']=$startdate) and
(!$picprinted) and ($piccount<$showlimit)) {

echo '<img src="'.$ad['thumb'].'" title="created on:'.date("M d,
Y",$ad['create_time']).'"/>';
echo '<br>';
$picprinted=true;
$piccount++;
}

}

}


?>


Make sense? Sure! You can run your mouse over the picture to see the
date the listing was created. Hope that helps.




--- In oodleapi@yahoogroups.com, "ssoorton" <ssoorton@...> wrote:
>
> I am trying to gather records by date and also a set number returned.
> Can anyone provide some sample code of how to gather all ads for
> 02-28-08 and limit to 20 or 30.
>
> Any help appreciated in advance
>





Sun Mar 2, 2008 3:47 pm

kennethscoggins
Offline Offline
Send Email Send Email

Forward
Message #295 of 539 |
Expand Messages Author Sort by Date

I am trying to gather records by date and also a set number returned. Can anyone provide some sample code of how to gather all ads for 02-28-08 and limit to 20...
ssoorton
Offline Send Email
Feb 29, 2008
9:04 am

Hi! Have you already solved this? It's pretty easy to figure out if you use the documentation at developer.oodle.com, but I made you a little demo page you...
CrashDaddy
kennethscoggins
Offline Send Email
Mar 2, 2008
3:47 pm

hi thanks for reply if we use filter then why use if condition in foreach i want use filter for distance plz send me example CrashDaddy...
sheela harwani
sheela_1aug
Offline Send Email
Mar 4, 2008
3:36 pm

You're right, that 'if' statement in the 'foreach' loop checking to see if it's created on the right date is unnecessary, you can just take it out and the same...
CrashDaddy
kennethscoggins
Offline Send Email
Mar 4, 2008
9:07 pm

Should take about five minutes... Four minutes of that was finding out that there were no w-s-w listings 50 miles from here on that day (trust your code!), so...
CrashDaddy
kennethscoggins
Offline Send Email
Mar 4, 2008
9:22 pm

We can do a background image for the site so it will look like ours but here is the info so you need to email the backgound so that it can be uploaded All...
Scott O Orton
ssoorton
Offline Send Email
Mar 3, 2008
4:15 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help