Difference between revisions of "Extension talk:MarketResearch"
m |
m (→Development) |
||
| Line 86: | Line 86: | ||
</div> | </div> | ||
</pre> | </pre> | ||
| + | |||
| + | :this is working fine. but now some changes. the API supplier is requiring us to use a "[[Image:jumppage.pdf]]". Please take a look at this and email me your revised quote for financial and chronological requirements.--[[User:Phalseid|Phalseid]] 06:19, 17 July 2008 (NZST) | ||
Revision as of 18:19, 16 July 2008
Contents
Todo
- Cache and check modified date before retrieving entire content
- Add args for max description length, and max results
Input
<marketresearch>term-1,term-2,term-n</marketresearch>
- might want to do
<marketresearch>term-1+term-2+term-n</marketresearch>
- to make it neater.
The usual way to have many items in a tag are with separate lines,
<marketresearch> term-1 term-2 term-n </marketresearch>
- --nad 09:39, 12 July 2008 (NZST)
<php>$keywords = preg_split('/[\x00-\x1f+,]+/', trim($input));</php> This allows any of the forms above --nad 21:52, 12 July 2008 (NZST)
which will give formatted data from
http://www.marketresearch.com/feed/search_results.asp?bquery=computers&partnerid=951781402
- just one term is fine for now, have a call in to see how they handle multiple.... --Phalseid 05:47, 11 July 2008 (NZST)
- multiple is done in the form foo+bar:
http://www.marketresearch.com/feed/search_results.asp?bquery=computers+monitor&partnerid=951781402
--Phalseid 02:52, 12 July 2008 (NZST)
Process
the parsing needs to give
- the <TITLE>
- a snippet of the article(s)<DESCRIPTION></DESCRIPTION>
- the product id which is BUY id from the resultant XML file... (<BUY id=xxxxx)
Output
shows the title, description, and a link to buy it...
http://www.marketresearch.com/feed/cart/addtocart.asp?partnerid=951781402&productid=xxxxxxx
--Phalseid
Development
The current version is working and tested, check it out and give me some feedback. Its not caching yet, so there's quite a delay on page load and it will fail if the feed doesn't return valid xml etc. To use it include it like normal and set you partner id as in the following example: <php> include("$IP/extensions/MarketResearch.php"); $wgMarketResearchPartner = "951781402"; </php> The rendered output is in the following format, design aspects should be made as CSS rules in MediaWiki:Common.css.
<div class="marketresearch"> <div class="marketresearch-item"> <h3>Men's and Boys' Clothing</h3> <p>This report analyzes the worldwide markets for Men's & Boy's Clothing in Millions of US$. The specific product segments analyzed are Suits, Coats & Jackets, Shirts, T-Shirts, Trousers, Slacks and Jean...</p> <ul> <li><a href="...addtocart.asp?partnerid=951781402&productid=1281401">1281401</a></li> </ul> </div> <div class="marketresearch-item"> <h3>Fashion and Media - UK</h3> <p>Fashion brands and retailers have a long-standing relationship with women's magazines and, more recently, with men's magazines. Television has been used to a lesser extent, particularly as it is very ...</p> <ul> <li><a href="...addtocart.asp?partnerid=951781402&productid=1089359">1089359</a></li> <li><a href="...addtocart.asp?partnerid=951781402&productid=1089358">1089358</a></li> </ul> </div> <div class="marketresearch-item"> <h3>Clothing Retailing - UK</h3> <p>The clothing sector is the second largest in UK retail. The influx of value fashion has forced the specialists to re-think their value proposition, with the mid-market in particular feeling the squeez...</p> <ul> <li><a href="...addtocart.asp?partnerid=951781402&productid=1562450">1562450</a></li> <li><a href="...addtocart.asp?partnerid=951781402&productid=1562451">1562451</a></li> <li><a href="...addtocart.asp?partnerid=951781402&productid=1562452">1562452</a></li> </ul> </div> </div>
- this is working fine. but now some changes. the API supplier is requiring us to use a "File:Jumppage.pdf". Please take a look at this and email me your revised quote for financial and chronological requirements.--Phalseid 06:19, 17 July 2008 (NZST)



