def scrape(): mars_data = scrape_mars.scrape_mars_news() mars_data = scrape_mars.scrape_mars_featured_image() mars_data = scrape_mars.scrape_mars_weather() mars_data = scrape_mars.scrape_mars_facts() mars_data = scrape_mars.scrape_mars_hemisphere() mongo.db.collection.update({}, mars_data, upsert=True) return redirect("/", code= 302)
def scrape(): # Run scrapped functions mars_info = mongo.db.mars_info mars_data = scrape_mars.scrape_mars_news() mars_data = scrape_mars.scrape_mars_image() mars_data = scrape_mars.scrape_mars_hemisphere() mars_info.update({}, mars_data, upsert=True) return request("/", code=302)
def scrape(): mission_to_mars = mongo.db.mission_to_mars mars_data = scrape_mars.scrape_mars_news() mars_data = scrape_mars.scrape_mars_image() mars_data = scrape_mars.scrape_mars_weather() mars_data = scrape_mars.scrape_mars_facts() mars_data = scrape_mars.scrape_mars_hemisphere() mission_to_mars.update({}, data, upsert=True) return redirect("/", code=302)
def scrape(): mars_results = mongo.db.mars_results mars_data = scrape_mars.scrape_nasa_news() mars_data = scrape_mars.scrape_nasa_image() mars_data = scrape_mars.scrape_mars_twitter() mars_data = scrape_mars.scrape_mars_facts() mars_data = scrape_mars.scrape_mars_hemisphere() mars_results.update({}, mars_data, upsert=True) return redirect("/", code=302)
def scrape(): #run Scrapped function mars_dict = mongo.db.mars_dict mars_data = scrape_mars.scrape_mars_news() mars_data = scrape_mars.scrape_mars_image() mars_data = scrape_mars.scrap_mars_weather() mars_data = scrape_mars.scrape_mars_fact() mars_data = scrape_mars.scrape_mars_hemisphere() mars_dict.update({}, mars_data, upsert=True) return redirect("/",code=302)
def scrape(): # Run the scrape function mars_data = mongo.db.mars_data mars_info = {} mars_info['news'] = scrape_mars.scrape_mars_news() mars_info['featured'] = scrape_mars.scrape_mars_featured() mars_info['facts'] = scrape_mars.scrape_mars_facts() mars_info['mars_hemisphere'] = scrape_mars.scrape_mars_hemisphere() # Update the Mongo database using update and upsert=True mars_data.update({}, mars_info, upsert=True) # Redirect back to home page return redirect("/")
def scrape(): # Run the scrape function mars_data = mongo.db.mars_data mars_data = scrape_mars.scrape_mars_news() mars_data = scrape_mars.scrape_featured_img() mars_data = scrape_mars.scrape_mars_facts() mars_data = scrape_mars.scrape_mars_weather() mars_data = scrape_mars.scrape_mars_hemisphere() #mars_data.update({}, mars_data, upsert=True) # Update the Mongo database using update and upsert=True mongo.db.mars_data.update({}, mars_data, upsert=True) # Redirect back to home page return redirect("/")