Ignore:
Timestamp:
11/20/22 16:34:52 (2 years ago)
Author:
Marko <Marko@…>
Branches:
master
Parents:
ffd50db
Message:

Final features implemented

File:
1 edited

Legend:

Unmodified
Added
Removed
  • phonelux_scrappers/phones_image_setter.py

    rffd50db r47f4eaf  
    1313    offers = list(json.loads(requests.get('http://localhost:8080/phones/offers/' + phone_id).text))
    1414
    15     offers = list(filter(lambda offer: offer['image_url'] is not None, offers))
     15# remove mobitech condition
     16    offers = list(filter(lambda offer: offer['image_url'] is not None and 'mobitech' not in offer['image_url']
     17                         , offers))
    1618
    1719    image_url = None
    1820
     21    if len(offers) > 1:
     22        image_url = offers[1]['image_url']
     23
    1924    if len(offers) > 0:
    2025        image_url = offers[0]['image_url']
     26
     27    # print('phone :'+str(phone))
     28    # print(image_url)
     29    # print('------------------------------')
    2130
    2231    phone['image_url'] = image_url
Note: See TracChangeset for help on using the changeset viewer.