Skip to content

Instantly share code, notes, and snippets.

@nucleogenesis
Last active April 24, 2019 19:31
Show Gist options
  • Save nucleogenesis/c101b54f5c47914f7dae633396a78f69 to your computer and use it in GitHub Desktop.
Save nucleogenesis/c101b54f5c47914f7dae633396a78f69 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from ricecooker.chefs import SushiChef
from ricecooker.classes.nodes import TopicNode, DocumentNode, SlideshowNode
from ricecooker.classes.files import DocumentFile, SlideImageFile
from ricecooker.classes.licenses import get_license
class SimpleChef(SushiChef):
channel_info = {
'CHANNEL_TITLE': 'Learning Equality Slideshow Demo',
'CHANNEL_SOURCE_DOMAIN': 'LE',
'CHANNEL_SOURCE_ID': 'LE Slideshow Demo',
'CHANNEL_LANGUAGE': 'en',
'CHANNEL_THUMBNAIL': 'https://cdn-images-1.medium.com/max/1200/1*p9WrYoHnY5lBPb86Hfuf2g.png',
'CHANNEL_DESCRIPTION': 'Learning Equality Slideshow Demo',
}
def construct_channel(self, **kwargs):
channel = self.get_channel(**kwargs)
root_topic = TopicNode(title="Learning Equality", source_id="le-demo-1")
slideshow_node = SlideshowNode(
title="Learning Equality Slideshow",
description="Slideshow Content Demo for LE",
source_id='le-demo',
author="Jacob Pierce",
language='en',
license=get_license('CC BY', copyright_holder='Learning Equality'),
files=[
SlideImageFile(
path='https://www.ffwd.org/wp-content/uploads/team-learning-equality.png',
language='en',
caption="Welcome to the Learning Equality Slideshow Demo!"
),
SlideImageFile(
path='https://learningequality.org/static/img/kolibri-logo.png',
language='en',
caption="Presented in Kolibri!"
),
SlideImageFile(
path='https://learningequality.org/static/img/kickstarter/fb-sharedlink.png',
language='en',
caption="Kolibri makes high quality education technology available in low-resource communities such as rural schools, refugee camps, orphanages, non-formal school systems, and prison systems."
),
SlideImageFile(
path='https://d3e7x39d4i7wbe.cloudfront.net/uploads/photo/image/4329/Kolibri_Coach_Report_Screenshot_copy-1490059526.jpg',
language='en',
caption="Here is a big image for a slide! I hope it looks good in the Slideshow Renderer!"
),
SlideImageFile(
path='https://static1.squarespace.com/static/54527a9de4b0d6969dc31aad/t/54e970b1e4b0c686e9149f55/1424584883133/',
language='en',
caption="Where it all started..."
),
SlideImageFile(
path='https://static.wixstatic.com/media/af0436_b266774a1dfe4e5e82296efa1e74485a.png/v1/fill/w_690,h_308,al_c,lg_1,usm_0.66_1.00_0.01/af0436_b266774a1dfe4e5e82296efa1e74485a.png',
language='en',
caption="Look at all of those flags across the globe!"
),
SlideImageFile(
path='https://static1.squarespace.com/static/54527a9de4b0d6969dc31aad/t/54e96a34e4b0e3df8c11bfcd/1424583224095/',
language='en',
caption="Letterboxing images makes sure that, no matter the size of the slideshow image, it will be fully visible to the user!"
),
SlideImageFile(
path='https://static1.squarespace.com/static/56b7fd002fe131f13536d1fe/t/5a612fa5ec212d53a3fcb6c3/1540353538240/LearningEquality_AuthoringTool.png',
language='en',
caption="One more LE related image before it's cats."
),
SlideImageFile(
path='https://i.imgur.com/6be9m8u.jpg',
language='en',
caption="My outside cat, Fang... also, a long cat lorem ipsum: Lick left leg for ninety minutes, still dirty attack like a vicious monster need to check on human, have not seen in an hour might be dead oh look, human is alive, hiss at human, feed me for you call this cat food so chew iPad power cord. Fall asleep on the washing machine you have cat to be kitten me right meow i shredded your linens for you stick butt in face munch on tasty moths for you have cat to be kitten me right meow. Sleep on dog bed, force dog to sleep on floor sit on human they not getting up ever but jump around on couch, meow constantly until given food, . Cat snacks cat dog hate mouse eat string barf pillow no baths hate everything but meow meow. Chew on cable. "
)
],
)
doc_node = DocumentNode(
title='Demo PDF',
description='A dummy PDF File!',
source_id='/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
author="W3C",
language='en',
license=get_license('CC BY', copyright_holder='W3C'),
files=[
DocumentFile(
path='https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
language='en',
)
],
)
other_topic = TopicNode(title="Documents", source_id="W3C")
other_topic.add_child(doc_node)
root_topic.add_child(other_topic)
channel.add_child(root_topic)
root_topic.add_child(slideshow_node)
return channel
if __name__ == '__main__':
"""
Run this script on the command line using:
python simple_chef.py -v --reset --token=YOURTOKENHERE9139139f3a23232
"""
simple_chef = SimpleChef()
simple_chef.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment