Created
April 11, 2012 11:24
-
-
Save paparent/2358723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os | |
from fom.session import Fluid | |
if __name__ == '__main__': | |
fdb = Fluid() | |
fdb.login('sportsdirect.com', os.environ['FI_SPORTSDIRECT_PASSWORD']) | |
datas = [ | |
{ | |
'about': 'karrimor boa sunglasses', | |
'title': 'Karrimor Boa Sunglasses', | |
'url': 'http://www.sportsdirect.com/karrimor-boa-sunglasses-756044', | |
'price': '£13.00', | |
'image': 'http://images.sportsdirect.com/images/products/75604490_l.jpg', | |
}, | |
{ | |
'about': 'no fear cobra cap junior', | |
'title': 'No Fear Cobra Cap Junior', | |
'url': 'http://www.sportsdirect.com/no-fear-cobra-cap-junior-391117', | |
'price': '£3.99', | |
'image': 'http://images.sportsdirect.com/images/products/39111703_l.jpg', | |
}, | |
] | |
for data in datas: | |
fdb.values.put( | |
query='fluiddb/about="%s"' % data['about'], | |
values={ | |
'sportsdirect.com/url': {'value': data['url']}, | |
'sportsdirect.com/title': {'value': data['title']}, | |
'sportsdirect.com/price': {'value': data['price']}, | |
'sportsdirect.com/image': {'value': data['image']}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment