def __repr__(self): return '<title:%s img:%s url:%s baseurl:%s hateb:%s>' % (self.title, self.img, self.url, self.baseurl, self.hateb) # main usys = UpdateSys() if not usys.run_update(): print 'already running.' sys.exit() # Truncate bookrank = BookRankingUpdater() bookrank.truncate() # Update for e in BookEntryUpdater.get_all(): entry_id = e.id opt = {} opt['Keywords'] = e.term opt['SearchIndex'] = e.searchindex if e.node: opt['BrowseNode'] = e.node opt['ResponseGroup'] = 'Medium,Reviews' opt['ItemPage'] = 1 print entry_id, opt root = item_search(**opt) total_results = int(root.Items.TotalResults) print total_results keywords = opt['Keywords'] items = []
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #--------------------------------------------------------------------------- from model.bookentry import BookEntryUpdater e = BookEntryUpdater() e.add('PHP', "", 'PHP', 'Books', '466298') e.add('Perl', "", 'Perl', 'Books', '466298') e.add('Ruby', "", 'Ruby', 'Books', '466298') e.add('Python', "", 'Python', 'Books', '466298') e.add('HTML5', "", 'HTML5', 'Books', '466298') e.add('JavaScript', "", 'JavaScript', 'Books', '466298') e.add('CSS', "", 'CSS', 'Books', '466298') e.add('ActionScript', "", 'ActionScript', 'Books', '466298') e.add('C', "", u'C言語', 'Books', '466298') e.add('C++', "", 'C++', 'Books', '466298') e.add('C#', "", 'C#', 'Books', '466298') e.add('Objective-C', "", 'Objective-C', 'Books', '466298') e.add('Java', "", 'Java', 'Books', '466298') e.add('Scala', "", 'Scala', 'Books', '466298')