@@ -0,0 +1,1140 @@
+# -*- encoding: utf-8 -*-%0Aimport pycrest%0Aimport datetime%0A%0Aimport lazyblacksmith.utils.crestutils%0Afrom lazyblacksmith.models import db%0Afrom lazyblacksmith.models import IndustryIndex%0A%0Adef get_industry_index():%0A    %22%22%22%0A    Connect to the public CREST and get the industry indexes list.%0A    %22%22%22%0A    crest = crestutils.get_crest()%0A    industry_system_page = crest.industry.systems()%0A%0A    insert_index_list = %5B%5D%0A%0A    # get all indexes%0A    all_indexes = crestutils.get_all_items(industry_system_page)%0A%0A    # TODO: get the date from headers%0A    # check if the data are not still from cache and if we don't already have them.  %0A    date = datetime.utcnow()%0A%0A    for index in all_indexes:%0A        solar_system = industry_system_page.solarSystem.id%0A%0A        for activity_index in index.systemCostIndices:%0A            row = %7B%7D%0A            row%5B'solarsystem_id'%5D = solar_system%0A            row%5B'date'%5D = date%0A            row%5B'activity'%5D = index.solarSystem.id%0A            row%5B'cost_index'%5D = index.solarSystem.id%0A            insert_index_list.append(row)%0A%0A    db.engine.execute(%0A        IndustryIndex.__table__.insert(),%0A        insert_index_list%0A    )%0A

Create a basic task to get the industry indexes