Tagtoo Intern

Welcome onboard

setup your account

github

email

slack

The first homework

learn how to cowork

EC-Parser

Collect item information

http://commondatastorage.googleapis.com/tagtoo-spider-report/2015-01-04T11%3A30%3A32.html

Github

  • How to git
  • create issue, feature branch, ...
  • commit carefully
    • don't commit unnecessary file
    • don't commit debug code
    • always git status before any step

Coding

  • Setup requirement
    • sudo pip install -r requirements.txt
  • Coding Style
    • think before you commit 
    • not sure? check code first
  • Learn Parser Framework
    • parser atom 
    • Schema Check
    • test env

class AndenHud(EC):
    _commerce_name = 'andenhud' 
    _commerce_id = 120             
    _url = 'http://www.andenhud.com.tw/'
    _test_uri = 'http://www.andenhud.com.tw/products/new_products_list.php?viewall=1&cid=3'
    allows = ['www\.andenhud\.com.tw'] # whitelist the ec's domain name

    def _get_key(self, url):
        assert self.check(url), 'not allow url'
        return self.commerce_name + ":" + parser_key(url) # your logic

    def _get_product(self, url):
        assert self.check(url), 'not allow url' 
        html = self.request(url).content  # always use self.request      
        result = parser_item(html)        # your logic
        return result


from ec.site import site
site.regist_ec(AndenHud())

Parser Atom

Unittest

  • Collect test case
  • coverage
python collect_case.py add-test-case [url]
python collect_case.py collect [ec-id]
nosetests

Pull Request, Code Review

  • https://magnum.travis-ci.com/Tagtoo/ec
  • Ask George or HHH review
  •  
  • Only code-review / deploy once per day

Status Report

 

Others

Daily Standup meeting

Tagtoo Intern

By Chien-Hsun Chen

Tagtoo Intern

  • 1,154