import tempfile from le_utils.constants import licenses, file_formats from bs4 import BeautifulSoup from selenium import webdriver """ Run Constants""" ########################################################### CHANNEL_NAME = "Example Open Stax" # Name of channel CHANNEL_SOURCE_ID = "souschef-example-learningequality" # Channel's unique id CHANNEL_DOMAIN = "openstax.org" # Who is providing the content CHANNEL_LANGUAGE = "en" # Language of channel CHANNEL_DESCRIPTION = None # Description of the channel (optional) CHANNEL_THUMBNAIL = "https://pbs.twimg.com/profile_images/461533721493897216/Q-kxGJ-b_400x400.png" # Local path or url to image file (optional) PATH = path_builder.PathBuilder(channel_name=CHANNEL_NAME) # Keeps track of path to write to csv WRITE_TO_PATH = "{}{}{}.zip".format(os.path.dirname(os.path.realpath(__file__)), os.path.sep, CHANNEL_NAME) # Where to generate zip file """ Additional Constants """ ########################################################### BASE_URL = "https://openstax.org/api" # Map for Open Stax licenses to le_utils license constants LICENSE_MAPPING = { "Creative Commons Attribution License": licenses.CC_BY, "Creative Commons Attribution-NonCommercial-ShareAlike License": licenses.CC_BY_NC_SA, } COPYRIGHT_HOLDER = "Rice University" # Set up logging tools
import tempfile import zipfile from bs4 import BeautifulSoup from le_utils.constants import licenses from ricecooker.utils.html import download_file from ricecooker.utils.zip import create_predictable_zip """ Run Constants""" ########################################################### CHANNEL_NAME = 'Example Wikipedia' # Name of channel CHANNEL_SOURCE_ID = '*****@*****.**' # Channel's unique id CHANNEL_DOMAIN = 'en.wikipedia.org' # Who is providing the content CHANNEL_LANGUAGE = 'en' # Language of channel CHANNEL_DESCRIPTION = '' # Description of the channel (optional) CHANNEL_THUMBNAIL = 'https://vignette2.wikia.nocookie.net/uncyclopedia/images/6/63/Wikipedia-logo.png' # Local path or url to image file (optional) PATH = path_builder.PathBuilder(channel_name=CHANNEL_NAME) WRITE_TO_PATH = "{}{}{}.zip".format(os.path.dirname( os.path.realpath(__file__)), os.path.sep, CHANNEL_NAME) # Where to generate zip file """ Additional Constants """ ########################################################### BASE_URL = 'https://en.wikipedia.org/wiki' # Set up logging tools LOGGER = logging.getLogger() __logging_handler = logging.StreamHandler() LOGGER.addHandler(__logging_handler) LOGGER.setLevel(logging.INFO) # License to be used for content under channel CHANNEL_LICENSE = licenses.PUBLIC_DOMAIN