Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Jekyll site CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the site in the jekyll/builder container
run: |
docker run \
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: _site # The folder the action should deploy.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ _site
tmp
env
vendor
.bundle
.bundle
.jekyll-cache
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
source 'https://rubygems.org'

gem 'jekyll', '~> 3.6.3'
gem 'jekyll'
gem 'jekyll-coffeescript'

gem "webrick", "~> 1.7"
78 changes: 49 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,60 +1,80 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorator (1.1.0)
execjs (2.7.0)
ffi (1.11.3)
concurrent-ruby (1.1.10)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb
eventmachine (1.2.7)
execjs (2.8.1)
ffi (1.15.5)

forwardable-extended (2.6.0)
jekyll (3.6.3)
http_parser.rb (0.8.0)
i18n (1.10.0)
concurrent-ruby (>= 1.0)
jekyll (4.2.2)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.14)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (>= 1.7, < 3)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-coffeescript (2.0.0)
coffee-script (~> 2.2)
coffee-script-source (~> 1.12)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-watch (1.5.1)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (1.17.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mercenary (0.4.0)

pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (2.2.1)
forwardable-extended (>= 2.6)
public_suffix (4.0.7)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (>= 1.0)
rexml (3.2.5)
rouge (3.28.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
webrick (1.7.0)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
jekyll (~> 3.6.3)
jekyll
jekyll-coffeescript
webrick (~> 1.7)

BUNDLED WITH
1.17.3
2.3.14
78 changes: 78 additions & 0 deletions _bin/gobo_scrape.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
from unittest import result
import requests
import yaml
from yaml import Loader, Dumper
from bs4 import BeautifulSoup, element
import os.path


with open("_data/gobos.yml", "r") as f:
gdata = yaml.load(f, Loader=Loader)

for gobo in gdata:
gobo_num = ''.join(str(gobo['number']).split())
print(gobo_num)
if not 'name' in gobo:
filename = ''
if gobo['make'] == 'Goboland':

# Get gobo information from goboland.com
goboland_search_url = 'https://www.goboland.com/advanced_search_result.php?keywords=' + gobo_num + '&psearch=products&location=United-Kingdom'
goboland_html = requests.get(goboland_search_url)
assert goboland_html.status_code == 200, "Failed to fetch from goboland.com"

s = BeautifulSoup(goboland_html.text, 'lxml')
name = s.find('span', {'class' : 'searchLinks'})
if name is None:
pass

gobo['name'] = name.text

# Get gobo image
gobo_info = name.parent.parent.parent
imgurl = 'https://www.goboland.com/' + gobo_info.find('img').get('src')
filename = 'goboland-' + gobo_num + '.jpg'



elif gobo['make'] == 'Rosco':

# Get gobo information from rosco.com
rosco_search_url = 'https://emea.rosco.com/en/products/catalog/gobos?search=' + str(gobo_num)
rosco_html = requests.get(rosco_search_url)
assert rosco_html.status_code == 200, "Failed to fetch from rosco.com"

s = BeautifulSoup(rosco_html.text, 'lxml')
names = s.find_all('div', {'class' : 'product-item'})
if names is None:
pass

for result in names:
number = result.find('span', {'class' : 'name'}).text
if number == gobo_num:
name = result.find('span', {'class' : 'text-box'}).text.strip().split('\n')[0]
image = result.find('img').get('src')
break

gobo['name'] = name


# Get gobo image
imgurl = 'https://emea.rosco.com/' + image
filename = 'rosco-' + gobo_num + '.jpg'

if filename is not '':
path = 'images/gobos/' + filename
if not os.path.exists(path):
with open(path, 'wb') as f:
f.write(requests.get(imgurl).content)

gobo['image'] = filename



with open("_data/gobos.yml", "w") as f:
stream = yaml.dump(gdata, Dumper=Dumper, width=720, indent=2)
stream = stream.replace('\n- ', '\n\n- ')
stream = stream.replace('!!python/unicode ', '')
f.write(stream)
13 changes: 7 additions & 6 deletions _bin/lee_scrape.py → _bin/lee_scrape_legacy.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import requests
import yaml
from yaml import Loader, Dumper
from bs4 import BeautifulSoup, element

lee_html = requests.get("http://leefilters.com/lighting/colour-list.html")
lee_html = requests.get("http://web.archive.org/web/20210618025008id_/http://leefilters.com/lighting/colour-list.html")

assert lee_html.status_code == 200, "Failed to fetch from leefilters.com"

s = BeautifulSoup(lee_html.text, 'html.parser')

print "**{}**".format(s.title.string)
print("**{}**".format(s.title.string))

lee_gels = {}

Expand All @@ -26,21 +27,21 @@
'description': description,
}

print "{} colour refs acquired".format(len(lee_gels))
print("{} colour refs acquired".format(len(lee_gels)))

with open("_data/gels.yml", "r") as f:
gdata = yaml.load(f)
gdata = yaml.load(f, Loader=Loader)

for gel in gdata:
if gel['code'] in lee_gels:
gel['color'] = str(lee_gels[gel['code']]['color'])
gel['name'] = str(lee_gels[gel['code']]['name'])
gel['description'] = str(lee_gels[gel['code']]['description'])
else:
print "Our {} is not present on leefilters.com".format(gel['code'])
print("Our {} is not present on leefilters.com".format(gel['code']))

with open("_data/gels.yml", "w") as f:
stream = yaml.dump(gdata, width=720, indent=2)
stream = yaml.dump(gdata, Dumper=Dumper, width=720, indent=2)
stream = stream.replace('\n- ', '\n\n- ')
stream = stream.replace('!!python/unicode ', '')
f.write(stream)
18 changes: 10 additions & 8 deletions _bin/stocktake.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import csv
import yaml
from yaml import Loader, Dumper

igels = {}

Expand Down Expand Up @@ -28,13 +29,13 @@ def input_colour(code, result, mode='cut'):
sheets[row[0]] = 1

# Do sheets
for code, qty in sheets.iteritems():
for code, qty in sheets.items():
input_colour(code, qty, 'sheet')

with open("_data/gels.yml", "r") as f:
ogels = yaml.load(f)
ogels = yaml.load(f, Loader=Loader)

print "{} gels to process, processing all known".format(len(igels))
print("{} gels to process, processing all known".format(len(igels)))

for ogel in ogels:
code = ogel['code']
Expand All @@ -55,12 +56,12 @@ def input_colour(code, result, mode='cut'):
ogel['stock']['cut'] = 'none'
ogel['stock']['sheet'] = 0

print "{} gels to process, processing unknowns".format(len(igels))
print("{} gels to process, processing unknowns".format(len(igels)))

if len(igels) > 0:
print "Gels not known to the catalogue exist! Scrape or manually add data afterwards."
print("Gels not known to the catalogue exist! Scrape or manually add data afterwards.")

for code, stock in igels.iteritems():
for code, stock in igels.items():
if 'cut' not in stock:
stock['cut'] = 'none'
if 'sheet' not in stock:
Expand All @@ -75,9 +76,10 @@ def input_colour(code, result, mode='cut'):
})

with open("_data/gels.yml", "w") as f:
stream = yaml.dump(ogels, width=720, indent=2)
stream = yaml.dump(ogels, Dumper=Dumper, width=720, indent=2)
stream = stream.replace('\n- ', '\n\n- ')
stream = stream.replace('!!python/unicode ', '')
f.write(stream)

print "done"
print("done")

Loading