Showing posts with label ebay. Show all posts
Showing posts with label ebay. Show all posts

Dec 12, 2009

Ebay vs Craigslist: the Follow up


Browsing the Internet, I came across a cool article that talks about who to believe; Ebay or Craigslist. It is extremely hard to figure what is really going on just because this is a superior management ownership issues that perhaps involves secret information that could not be revealed in a week. No one denies that Ebay was seeking ownership of Craigslist; mostly because they bought stake of 28% on 2004. In the following paragraphs, I'm going to elaborate more on Ebay's point of view as well as Craigslist's point of view.

Starting with Ebay point of view, the former CEO Whitman stated that the move was mainly made because Ebay wanted to increase their share of the pie. According to Whitman, concerns about the relationship between both companies rose when Ebay founder Pierre Omidyar became frustrated with Craiglist. Her argument was that really no one ever dislikes Omidyar; when he's not happy with someone, this could also mean that who ever gets under his skin is probably doing something annoying.

Ending with Craigslists's point of view, Newmark and Buckmaster stated that Ebay betrayed them and that especially Whitman broke promises that she had given earlier to Craigslist when she started playing with their confidential data allegedly related to their hit website Craigslist.org. The concern in Craigslist rose when Ebay began creating their own classified website, oddly enough named Kijiji. Whether the right is on Ebay or Craigslist, it would not really change a thing because the launching of Kijiji changed the perspective of Classified websites. The real question is, how is this trial going to affect the ownership of Craigslist.

Dec 8, 2009

Ebay vs Craigslist





Top management at it's peak is what can be resembled out of the Ebay vs Craigslist trial. Many might assume that it is just a case. Well, they might be right only if Ebay was not one of the largest online corporations that generated 8.5 billion of revenues in the year of 2008, and only if Craigslist was not the top US online classified site. According to the article, Ebay sued Craigslist for lowering its ownership stakes by around 4 percentages making Ebay owners of 24.85 percent of Craiglist. It did not take Craigslist much to respond; a month later, Craigslist sued Ebay for trying to take over Craiglist ownership so they can use Craigslist "secret success recipe" and launch its own classified site. In the following paragraphs, A closer look at the trial and comments of trial participants will be highlighted.

Whitman , who was the chief executive officer, took the stand on Monday saying that Ebay only reason for buying Craigslist stakes was to eventually gain full ownership of Craigslist. By doing so, Ebay can keep competitors in the house. It was revealed also by Whitman that Ebay had paid 32 million dollars or its stake in Cragslist, but then realized early on that gaining complete ownership over Craigslist would not be possible. The main rationale for Ebay case was that Craigslist's co founder and chief executive officer developed a coercive plan to lower its stake. On the other hand, Craigslist main rationale was that Ebay never mentioned that it was going to launch Kijiji, which was operating in the US by 2008.

Ebay explanation about not mentioning the launch of Kijiji was that Ebay had not closed the deal with Craigslist at the time and therefore retained from giving out this kind of sensitive information. Furthermore, Ebay founder Pierre Omidyar said that he did mention to Craigslist that Ebay plans to strongly enter the classified online market. What's interesting about this is the difference between these two corporations; Ebay is a huge corporations with hundreds of employees whereas Craigslist is a small privately owned company with maybe 25 employees or so. This makes one think how creativity and hard work can change lives. The trial would most likely go for a week and all we can do is wait!

Nov 18, 2009

Parsing Errors

While parsing our xml data to display it, our script sometimes used to stop working. This inpredictable behavior was very strange and it was difficult to find the problem. The error occured at the Ebay part. First we thought that it might be a problem with the Ebay server. Monitoring the parsing gave us only a small hint.
It must be a problem with the picture URL from the articles.
Working through the Ebay-response, we realized that tags "title", "currentPrice", "url" are mandatory. Some tags, like the "galleryURL" are not.

<item>
<title>Best 5 LED Bike Bicycle Tail Light Lamp &amp; Bike Holder</title>
<galleryURL>http://thumbs4.ebaystatic.com/pict/3204463049958080_1.jpg</galleryURL>
<viewItemURL>http://cgi.ebay.com/Best-5-LED-Bike-Bicycle-Tail-Light-Lamp-Bike-Holder_W0QQitemZ320446304995QQcmdZViewItemQQptZCycling_Parts_Accessories?hash=item4a9c1692e3</viewItemURL>
...
</item>
For parsing, we use this code:
var text="<table border='1'>";
for (var j=0;j<xmlData.getElementsByTagName("title").length;j++){
//loop for iterating over the item's title, URL, pic, and price
text=text+"<tr><td><a href='"+
//starting a new table row and starting the link
xmlData.getElementsByTagName("viewItemURL")[j].childNodes[0].nodeValue+
//gets the first URL
"'target=_blank>"+xmlData.getElementsByTagName("title")[j].childNodes[0].nodeValue+"</a></td><br />"+
// gets the first Title
"<td><img src="+xmlData.getElementsByTagName("galleryURL")[j].childNodes[0].nodeValue++" /></td>"+
// gets the first pictureURL
"<td>"+xmlData.getElementsByTagName("currentPrice")[j].childNodes[0].nodeValue+"</td></tr>";}
// gets the first Price, loop starts again, or ends.
text=text+"</table>";
// closing HTML table-tag
appDiv=document.getElementById("itemContent");
appDiv.innerHTML=text;

Today we implemented yahoo shopping. While parsing the shopping articles with this code:
for (i=0;i<Json_data.length;i++)
{
textYa=textYa+"<tr><td><a href='"+
//new tablerow, starting link
Json_data[i].Offer.Url+
//getting URL
"'>"+Json_data[i].Offer.ProductName+"</a></td>"
//getting Product Name
+"<td><img src="+Json_data[i].Offer.Thumbnail.Url+" />
//getting pic URL
</td><td>"+Json_data[i].Offer.Price+"</td></tr>";
//getting price
;}
}
textYa=textYa+"</table>";
YahooDiv=document.getElementById("yelpContent");
YahooDiv.innerHTML=textYa;
We had the same problems with this yahoo like we have with Ebay. We discovered that Yahoo Shopping returns not only "Offers" but "Catalogs" with not usable data. Now, before we try to access the data, we check for an Offers-object. If true, we work on. If not, we skip it. Checking for a picture URL works the same way. If it is undefined, we return only a blank.
With yahoo-shopping, we are working on the objects, things are not that easy with Ebay. As we use the getElementsByTagName()-function, we pick out all tags with the given tag-name.
This means that there are no gaps in the galleryURL. If one item does not have an galleryURL, the system takes the next one. In the case that, at least, one article has no galleryURL, the array of Elements is shorter than the array with the title-tags, causing the exception.
The workaround at the moment is to check for access to undefined variables and to avoid this by returning an empty string. It adds entries in the end of the array, if needed.

Maybe one of you has a good idea how to fix this bug. My idea, taking the item-tags and moving through the childs does not work...

Update:
Now, I got things working. Using try-catch parts allows us to insert a galleryURL everytime an exception is catched.
try {
if (items[no].getElementsByTagName("galleryURL")[0].childNodes[0].nodeValue==undefined) {
gal_Url=" ";} else {
gal_Url=items[no].getElementsByTagName("galleryURL")[0].childNodes[0].nodeValue;
}
}
catch (e) {
gal_Url=" ";
}


Code, written in a try-block is treated specially. If an error appears, the compiler does not stop the script, but it goes to the catch-part of the code. An additional option is to use a finally-part to perform some clean-up works that should be performed in the error or in the usual case.

Oct 27, 2009

Our group-project -> Buy-lingu.al

After I posted the main secrets of our group work, I will post something about the project and our solved and unsolved problems.
We started by working parallel. One part of the group designed the website layout. The others researched how to get the api's running.
The first idea was to use eBay’s and Google’s JavaScript files. These display the results in their div-tags. We implemented them and had them running. At Iteration I we presented a website that translated a keyword and, after checking an alert box, searches eBay and displays the results on our website.
The next step was to understand the eBay JavaScript files to hook into that part with our retranslation. We found a possibility to get the title of the eBay items and give them to the retranslation part of our JavaScript file and integrate the translated title back into the result page.
We thought we were almost done, only fixing some bugs:
- removing the alert Box that shows the translation result causes that the scripts work parallel: eBay is searched before we had a result from google translate.
- removing the alert Box after the retranslation causes that the results were displayed without title.
These problems showed us the main problem: The different functions in the script do not wait for each other. We tried to find the solution in the scripts but we were not able to identify our problem.
When we got to the class when we talked about proxies, we researched the eBay and Google developer sites again and found the already posted solutions.
We threw our almost working code over and started again using the proxies.

Our actual code showed us that, in JavaScript, a sequence of functions are not running successively but parallel. We realized that the second function has to be started at the end of the first function.
Maybe somebody knows another way to assure that function b starts only after function a has ended?

Another problem that we have is to get the Amazon api running. If somebody has experience how to handle it, please let us know!

Ebay API

Our group projects deals with the translation from a keyword, searching eBay and Amazon for this keyword and retranslating the title of the result before displaying it. In this post I like to introduce how we managed the ebay search and how we work on the ebay data.
The first to know is that ebay needs you to sign-up for their developer program. After signing-up, for free, you are able to get the developer-keys. These keys are necessary to connect to the ebay server. Ebay supports a webservice. We get XML data by using the proxy.
Now, I will explain our sourcecode:

## JavaScript
var url="proxyEbay.php?rk="+trans;


The url for the request consists of our proxy file and the translated keyword (trans).

## PHP
$rk = $_REQUEST['rk'];


The handed value is saved in the variable $rk.

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=YOUR_AppID!!! &GLOBAL-ID=EBAY-US&keywords=YOUR_KEYWORD!!! &paginationInput.entriesPerPage=10';
This is the link to the ebay search. You have to change "YOUR_AppID!!!" to your ebay application id from the developers program and the "YOUR_KEYWORD!!!" with your keyword.

##PHP
$ur1 = 'http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsByKeywords&amp;SERVICE-VERSION=1.0.0&amp;SECURITY-APPNAME=YOUR_AppID!!!&amp;GLOBAL-ID=EBAY-US&amp;keywords=';
$ur2 = '&amp;paginationInput.entriesPerPage=10';
$uri =$ur1.$rk.$ur2;


We splitted the link into two parts to change the keyword.
The first part consists of the ebay function we use (findItemsByKeywords), the actual service version, our developer id. Please be aware that I do not publish our developer id. And the Ebay site we search.
The second part describes the entries that will be shown.
The $uri will be built from the first part, the translated keyword that we passed to the PHP file, $rk, and the second part with the help of the .methode.

The rest of the proxy is similar to the given one: With this url, we will start a curl-session and make the call.

The XML data we receive looks like this ( I shortend it. This is the XML header and only the first item)
<findItemsByKeywordsResponse xmlns:ms="http://www.ebay.com/marketplace/services" xmlns="http://www.ebay.com/marketplace/search/v1/services">
<ack>Success</ack>
<version>1.0.1</version>
<timestamp>2009-10-22T00:05:40.077Z</timestamp>
<searchResult count="10">

<item>
<itemId>220495266410</itemId>
<title>2 PEDROS PEDRO'S BICYCLES BIKES STICKERS, DECALS. NEW!!</title>
<globalId>EBAY-US</globalId>
<primaryCategory>
<categoryId>106953</categoryId>
<categoryName>Decals, Stickers</categoryName>
</primaryCategory>

<galleryURL>http://thumbs3.ebaystatic.com/pict/2204952664108080_1.jpg</galleryURL>
<viewItemURL>http://cgi.ebay.com/2-PEDROS-PEDROS-BICYCLES-BIKES-STICKERS-DECALS-NEW_W0QQitemZ220495266410QQcmdZViewItemQQptZCycling_Parts_Accessories</viewItemURL>
<paymentMethod>PayPal</paymentMethod>
<autoPay>false</autoPay>
<postalCode>27408</postalCode>
<location>Greensboro,NC,USA</location>
<country>US</country>
<shippingInfo>
<shippingServiceCost currencyId="USD">1.0</shippingServiceCost>
<shippingType>Flat</shippingType>
<shipToLocations>Worldwide</shipToLocations>
</shippingInfo>
<sellingStatus>
<currentPrice currencyId="USD">2.99</currentPrice>
<convertedCurrentPrice currencyId="USD">2.99</convertedCurrentPrice>
<bidCount>0</bidCount>
<sellingState>Active</sellingState>
<timeLeft>P0DT0H0M32S</timeLeft>
</sellingStatus>
<listingInfo>
<bestOfferEnabled>false</bestOfferEnabled>
<buyItNowAvailable>false</buyItNowAvailable>
<startTime>2009-10-15T00:06:12.000Z</startTime>
<endTime>2009-10-22T00:06:12.000Z</endTime>
<listingType>Auction</listingType>
<gift>false</gift>
</listingInfo>
</item>



Now it is easy to pick out the desired data. You can look manually for a specified tag by "getElementById("title")[0].childNodes[0].nodeValue" to get the tilte.
Or you can itarate over all found data. For the iteration you only need the count of the items:
test= request.responseXML;

for (i=0;i<test.getelementsbytagname("title").length;i++){>
title=test.getElementsByTagName("title")[i].childNodes[0].nodeValue;
}


We use this iteration to get the title retranslated into to users language.
I hope this will help someone with his project. If you have question or problems, feel free to contact me :)