Ejemplo n.º 1
0
def scraping():
    mars_info = mongo.db.mars_info

    #scrape_news()
    #scrape_image()
    #scrape_tweets()
    #scrape_facts()
    #scrape_hemispheres()

    news = scrape_mars.scrape_news()
    image = scrape_mars.scrape_image()
    tweets = scrape_mars.scrape_tweets()
    facts = scrape_mars.scrape_facts()
    hemispheres = scrape_mars.scrape_hemispheres()
    update_data = {
        'news': news,
        'image': image,
        'tweets': tweets,
        'facts': facts,
        'hemispheres': hemispheres
    }

    # listings.update({}, listings_data, upsert=True)
    mars_info.update({}, update_data, upsert=True)
    return redirect("/", code=302)
Ejemplo n.º 2
0
def scraper():
    mars_data = mongo.db.mars_data
    mars_info = scrape_mars.scrape_news()
    mars_info = scrape_mars.scrape_image()
    mars_info = scrape_mars.scrape_weather()
    mars_info = scrape_mars.scrape_facts()
    mars_info = scrape_mars.scrape_hemispheres()
    mars_data.update({}, mars_info, upsert=True)
    return redirect("/", code=302)
Ejemplo n.º 3
0
def scrape():
    #run scrape function
    mars_data = mongo.db.mars_data
    mars_information = scrape_mars.scrape_news()
    mars_information = scrape_mars.scrape_image()
    mars_information = scrape_mars.scrape_facts()
    mars_information = scrape_mars.scrape_hem()
    mars_data.update({}, mars_information, upsert=True)

    return redirect("/", code=302)
Ejemplo n.º 4
0
def scrape():
    # Run the scrape functions
    mars_data = scrape_mars.scrape_news()
    mars_data = scrape_mars.scrape_image()
    mars_data = scrape_mars.scrape_facts()
    mars_data = scrape_mars.scrape_weather()
    mars_data = scrape_mars.scrape_hemis()
    # Update the Mongo database using update and upsert=True
    mongo.db.collection.update({}, mars_data, upsert=True)

    return redirect("/", code=302)
Ejemplo n.º 5
0
def scrape():

    # Run scrapped functions
    mars_info = mongo.db.mars_info
    mars_data = scrape_mars.scrape_news()
    mars_data = scrape_mars.scrape_image()
    mars_f = scrape_mars.scrape_facts()
    mars_w = scrape_mars.scrape_weather()
    mars_data = scrape_mars.scrape_hemisphere()
    mars_info.update({}, mars_data, upsert=True)

    return redirect("/", code=302)
Ejemplo n.º 6
0
def scrape():
    mars_dict = mongo.db.mars_dict
    mars_data = scrape_mars.scrape_news()
    mars_data = scrape_mars.scrape_image()
    mars_data = scrape_mars.scrape_facts()
    mars_data = scrape_mars.scrape_hemispheres()

    # Update the Mongo Database using update and upsert=True
    mars_dict.update({}, mars_data, upsert=True)

    # Redirect back to home page
    return redirect("/", code=302)
Ejemplo n.º 7
0
def scrape():

    all_mars_info = mongo.db.all_mars_info
    new_data = scrape_mars.scrape_news()
    new_data = scrape_mars.scrape_image()
    new_data = scrape_mars.scrape_facts()
    new_data = scrape_mars.scrape_hemispheres()
    new_data = scrape_mars.scrape_weather()

    all_mars_info.update({}, new_data, upsert=True)

    return redirect("/", code=302)
Ejemplo n.º 8
0
def scrape():
    # Run scraped functions
    scrape_data = mongo.db.scrape_data
    mars_data = scrape_mars.scrape_nasa()
    mars_data = scrape_mars.scrape_image()
    mars_data = scrape_mars.scrape_weather()
    mars_data = scrape_mars.mars_facts()
    mars_data = scrape_mars.hemispheres()
    print(mars_data)
    scrape_data.update({}, mars_data, upsert=True)

    #Redirecting back to home page
    return redirect("/", code=302)
Ejemplo n.º 9
0
def scrape():

    # Run scraped functions
    mars_info = mongo.db.mars_info
    mars_data = scrape_mars.scrape_news()
    mars_data = scrape_mars.scrape_image()
    mars_data = scrape_mars.scrape_weather()
    mars_data = scrape_mars.scrape_facts()
    mars_data = scrape_mars.scrape_hemi_1()
    mars_data = scrape_mars.scrape_hemi_2()
    mars_data = scrape_mars.scrape_hemi_3()
    mars_data = scrape_mars.scrape_hemi_4()

    mars_info.update({}, mars_data, upsert=True)

    return redirect("/")
Ejemplo n.º 10
0
def scraper():

    news = mongo.db.news
    news_data = scrape_mars.scrape_news()
    news.update({}, news_data, upsert=True)

    image = mongo.db.image
    image_data = scrape_mars.scrape_image()
    image.update({}, image_data, upsert=True)

    weather = mongo.db.weather
    weather_data = scrape_mars.scrape_weather()
    weather.update({}, weather_data, upsert=True)

    table = mongo.db.table
    table_data = scrape_mars.scrape_facts()
    table.update({}, table_data, upsert=True)

    return redirect("/", code=302)
Ejemplo n.º 11
0
def scrape():

    article_info = scrape_mars.scrape_article()
    mongo.db.articles.update({}, article_info, upsert=True)

    featured = scrape_mars.scrape_jpl()
    mongo.db.jpl.update({}, featured, upsert=True)

    weather_stuff = scrape_mars.scrape_weather()
    mongo.db.weather.update({}, weather_stuff, upsert=True)

    facts = scrape_mars.scrape_facts()
    mongo.db.facts.update({}, facts, upsert=True)

    images = scrape_mars.scrape_image()
    mongo.db.images.remove({})

    for image in images:

        mongo.db.images.insert(image)

    return redirect("/")
Ejemplo n.º 12
0
def scrape():

    # Run the scrape function for MARS NEWS
    mars_news_data = scrape_mars.scrape_info_news()
    mongo.db.scrape_info_news.update({}, mars_news_data, upsert=True)

    # Run the scrape for features image MARS FEATURED_IMAGE_URL
    mars_image_data = scrape_mars.scrape_image()
    mongo.db.scrape_image.update({}, mars_image_data, upsert=True)

    # Run the scrape function for MARS TWITTER WEATHER
    mars_data = scrape_mars.scrape_info_weather()
    mongo.db.scrape_info_weather.update({}, mars_data, upsert=True)

    # Run the scrape function for MARS FACTS
    mars_facts_data = scrape_mars.scrape_info_facts()
    mongo.db.scrape_info_facts.update({}, mars_facts_data, upsert=True)

    # Run the scrape function for HEMI IMAGES
    mars_hemi_image_data = scrape_mars.scrape_hemi_image()
    mongo.db.scrape_hemi_image.update({}, mars_hemi_image_data, upsert=True)

    # Redirect back to home page
    return redirect("/")