Pet Scams!

We’ve been experiencing several reports of scam attempts especially with Pet ads. Please take caution!
Avoid 99% of the scams & fraud by dealing locally. Never wire funds or accept checks. Never give out any financial information.
Avoid deals that involve shipping or escrow services.
Remember that Love2Trade is only a venue and not involved in any transaction…


Please report any suspicious postings using the “report as spam” link or using the contact us page.

Thank you and Merry Christmas!

-Love2Trade.com

Oodle Json serialization Error converting value “j”

If you are using the Oodle .NET API library – OodleRestApi then you may have encountered an exception that looks like this:

First Exception: Error converting value "j" to type 'Love2Trade.OodleRestApi.Json.OodleResult+ImageData+ImageSizeData'.
Newtonsoft.Json.JsonSerializationException: Error converting value "j" to type 'Love2Trade.OodleRestApi.Json.OodleResult+ImageData+ImageSizeData'. ---> System.Exception: Could not cast or convert from System.String to Love2Trade.OodleRestApi.Json.OodleResult+ImageData+ImageSizeData.
at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable(Object value, Type initialType, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\ConvertUtils.cs:line 460
at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast(Object initialValue, CultureInfo culture, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Utilities\ConvertUtils.cs:line 385
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(Object value, Type targetType) in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\Serialization\JsonSerializerInternalReader.cs:line 464

I have updated the library and it’s now fixed. You can download it here

Awesome WordPress themes for a cheap price

If you are a wordpress fan and you you haven’t checked this site yet you should! It really is a collection of awesome wordpress themes. Check it out!!

Oodle .NET API library – OodleRestApi

So I recently started to focus my effort to switch over from the legacy xml interface with oodle to their new REST-based web service for love2trade.com since it promises to be 20 times faster!   I spent several hours trying to put this library together which should help others as well. Many thanks for Steve Baker from oodle in helping me get some issues sorted out.

We will make this library open source at some point in the near future. For now you are free to use the library & if you really want the code, shoot me an email!

OodleRestApi.NET is a free library that I have developed in my personal time. I would really appreciate your feedback and support for OodleRestApi and its future development.
Getting Started:
1. Download OodleRestApi dll from here (library is compiled in .NET 4.0)
Or get the OodleRestApi .NET 2.0 build from here
2.  In your project, add reference to the OodleRestApi library Love2Trade.OodleRestApi.dll
3. OodleRestApi uses  JSON.NET for deserializing oodle’s response. You will need to download the latests from http://json.codeplex.com/. After that you will need to add reference to Newtonsoft.Json.dll in your project
4. Now you are ready to roll!! The quickest way to learn is to show you a sample client.


//Create the OodleRequest object that will be serialized to the server
OodleRequest oodleRequest = new OodleRequest("TEST");
oodleRequest.Filter.location.Region = Regions.RegionTypes._usa;
oodleRequest.Paging.Start = 1;
oodleRequest.Paging.Num = 50;
oodleRequest.Filter.refinements = Filter.refinementsTypes.none;
oodleRequest.Paging.Sort = Paging.SortKey.ctime;
oodleRequest.Filter.attributes.AddPriceRange(5000, 6000);
oodleRequest.category = "vehicle";
oodleRequest.q = "honda civic";

//Creating the webrequest object - Notice that the oodleRequest is simply a string representation of your query which you can print to the screen for troubleshooting
WebRequest webRequest = WebRequest.Create(oodleRequest.ToString());
using (WebResponse response = webRequest.GetResponse())
{
    using (StreamReader reader = new StreamReader(response.GetResponseStream()))
    {
        //this will get the JSON result back from oodle
        string output = reader.ReadToEnd();
        //We do a minor alteration in the json string due to a problem oodle is facing with php's representation of objects as arrays
        output = output.Replace("\"location\":[]", "\"location\":{}").Replace("\"user\":[]", "\"user\":{}");
        OodleResult Result = JsonConvert.DeserializeObject<OodleResult>(output);
        //Now you can whatever you want with the results, you can start by iterating through Result.Listings to view all the listings your query returned
    }
}

You will notice that both the OodleRequest & OodleResponse objects represents a very similar structure to the structure defined by oodle in Oodle Api parameters

The Oodle Response is broken down to 5 main parts

  • Current – This contains information about the query that is returned, (ex. Region, Category, Start item #, Num or items returned).
  • Listings – This is a strong typed array of Listings. The maximum you will ever find is 50 items as defined by oodle
  • Meta – Metadata details on the results available. How many total items available for your search query…etc. This is very important if you are implementing paging in your result set.
  • Refinements – by default this is null unless you have requested refinements in your oodle request (ex. oodleRequest.Filter.refinements=none | simple | full)
  • Stat – should always be “ok” if everything runs good.

Everything else is really self explanatory and you can depend on your IDE’s intellisense to guide you. Feel free to comment on this post if you have any Qs.

Let me know your feedback!! :)

Support OodleRestApi
We appreciate your support for OodleRestApi

Anonymous ads are now supported!

We recently added a great new feature; anonymous ads are now supported! You no longer have to register in order to create a new ad – Not that the registration form was that long t being with :) but we do understand that many people would like to just quickly simply post a single ad. Enjoy and please send us your feedback & requests!

-Ash

Major upgrades to our servers!

We’re happy to announce that we recently completed some major upgrades to our servers. You should see a significant improvement in both speed and stability of Love2Trade.

Please don’t hesitate to let us know if you encounter an unexpected errors/issues!

Happy Shopping!!! :)

Pet fans….REJOICE!

We’re happy to announce that we now have a dedicated category for pet lovers. You can find many for sale listings in Birds, Cats, Dogs, Fish, HorsesRabbits, Reptiles, Livestock, and even Small furry animals! :)

We also have a dedicated section for Pet Supplies & Livestock Supplies!

As always we welcome and feedback or suggestions you might have!

Happy Shopping!! :)

Registration errors on Love2Trade

We’ve been noticing that several people have been getting errors when attempting to register a new account on Love2Trade specially when using Opera & Safari browsers. We’ve been working hard on resolving these issues.

One of the main changes we made is using a new anti-bot service (Captcha) that is more simple & “Accessibility friendly”. We’ve also changed some of the validations that seemed to be causing some confusion. We are hoping these recent changes will fix some (and hopefully all) issues that were recently reported.

Please don’t hesitate to contact us if you still have any problems registering a free account on Love2Trade.

Love2Trade Integration with PayPal©

Yes finally, Love2Trade is not just a “list for others to view” only kind of service! Your existing or new account at Love2Trade can now be integrated with PayPal©! 

PayPal© Acceptance Mark

This means you can start selling your stuff on Love2Trade and use your existing PayPal account to receive payments from almost anybody with an email address and a credit card, guaranteed by PayPal’s great policy

As always, these new features are FREE which means we do NOT charge a commision nor a listing fee to integrate your listings with PayPal (PayPal may still charge their standard processing fee, but there is nothing really we can do about that).

As a friendly reminder, even though you can use PayPal to accept payments, you can avoid 99% of the scams & fraud by dealing locally. Trust us when we say that you should never wire funds or accept checks, nor you should ever give out any financial information to others. Avoid deals that involve shipping or escrow services.

Remember that even though Love2Trade integrates with PayPal for the convenience of both the buyer & seller, we are still only a venue and we do not get involved in any transaction.

Simple Regex to Remove Html tags

This is one of the simplest regex to remove html tags from some html text. I know its not the best but i’d argue that it’s one of the simplest. ;)


public static string RemoveHtml(string txt)
{
    return Regex.Replace(txt, @"<[^>]*>", "");
}

Follow

Get every new post delivered to your Inbox.