Skip to content

Instantly share code, notes, and snippets.

@qsun
Created January 5, 2011 09:02
Show Gist options
  • Save qsun/766078 to your computer and use it in GitHub Desktop.
Save qsun/766078 to your computer and use it in GitHub Desktop.
<?php
/* license - GPL */
/* this function will extract terms from the text, by Yahoo Query Language's search.termextract API */
function extract_terms($content) {
$query = "SELECT * FROM search.termextract WHERE context = '" . str_replace("'", "", $content) . "'";
$query_url = 'http://query.yahooapis.com/v1/public/yql?q=' . urlencode($query) . '&format=json';
$session = curl_init($query_url);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$ret = curl_exec($session);
curl_close($session);
if ($ret !== false) {
return json_decode($ret)->query->results->Result;
} else {
throw new Exception(curl_error($session));
}
}
/*
var_dump(extract_terms('Buying pre-owned or pre-loved items are fast becoming a trend among people nowadays. Even used furniture has also joined the bandwagon. However, not anything used sells well. In fact, even if you offer them at a discounted price, getting people convinced into buying them is just as difficult as well.
In order to effectively sell used furniture, it is important that you know the different tricks of the trade. Otherwise, you will end up giving them away to charity or left inside your garage.
To start with, you need to give your furniture a new look. Whether you paint or polish it, making it appear newer and sleeker will do wonders on your used furniture. Learn a lesson from car dealers who recondition used cars before disposing them to potential customers. More often than not, buyers easily get attracted to items that look shinier as they give the impression of being new.
Sometimes, the time and the effort you spent in selling the item outweighs the profits that you will be earning. In which case, you can have an agent do the selling for you. An extra fee is better than having to lose more of your precious time which could have been used for other more profitable ventures. Besides, if there is anything that an agent is really good at, it is selling.
Make use of social networking sites to make your products known. The internet has provided people with a lot of conveniences that selling your item can now be done in just a few clicks of a mouse. Likewise, there are available sites wherein you are allowed to post your items for free. You can avail of this too. Besides, the more ads you make, the more awareness that you create. Eventually, this will result to more people showing an interest on what you sell.
Lastly, you can also come up with discounts or promos in order to attract more buyers. If you have several pieces, you can match them and offer them at a price of one. Remember that in selling used furniture, any effort to make your products move matters.'));
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment