Skip to content

Instantly share code, notes, and snippets.

View GuyMicciche's full-sized avatar

Guy Micciche GuyMicciche

View GitHub Profile
@GuyMicciche
GuyMicciche / Code by Zapier - Main HTMLParser.py
Last active August 17, 2023 21:03
Extracts specific content from HTML based on a dictionary input, and then processes the data into a structured output.
"""
Description:
This code implements a specialized HTML parser using Python's built-in
HTMLParser module. Its primary function is to extract specific content
from HTML based on user-defined tags and attributes. The code is tailored
to capture content from <h2> tags, <p> tags with the class 'themeScrp',
and <div> tags with a 'data-date' attribute of value 'tabContent'.
Once parsed, the extracted data is then processed to produce a concise
result containing the date, the full scripture text, a scripture reference,
and the daily text. This parser provides a flexible and efficient solution
@GuyMicciche
GuyMicciche / Code by Zapier - HTMLParser 3.py
Created August 17, 2023 20:59
# Extract the content of the second tabContent div from the list of all tabContent contents
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def __init__(self):
super().__init__()
self.recording = False
self.current_data = []
self.all_tabContent_contents = []
def handle_starttag(self, tag, attrs):
@GuyMicciche
GuyMicciche / Code by Zapier - HTMLParser 2.py
Created August 17, 2023 20:55
Extract the content of the second themeScrp tag from the list of all themeScrp contents
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def __init__(self):
super().__init__()
self.recording = False
self.current_data = []
self.all_themeScrp_contents = []
def handle_starttag(self, tag, attrs):
@GuyMicciche
GuyMicciche / Code by Zapier - HTMLParser 1.py
Last active August 17, 2023 20:55
Extract the content of the second h2 tag from the list of all h2 contents
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser):
def __init__(self):
super().__init__()
self.recording = False
self.current_data = []
self.all_h2_contents = []
def handle_starttag(self, tag, attrs):
@GuyMicciche
GuyMicciche / splitter.js
Created November 11, 2022 01:26 — forked from nlac/splitter.js
A small js snippet to split a merged audio track to parts by silence analysis. Based on ffmpeg "silencedetect" filter and node.js.
/**
* This javascript snippet is able to split a merged audio track to parts by silence analysis
* It is based on ffmpeg (https://ffmpeg.org), especially on the silencedetect filter (https://ffmpeg.org/ffmpeg-filters.html#silencedetect)
*
* Assumptions:
* - nodejs is installed
* - ffmpeg is installed
*
* Usage:
* - fill the options object
Hex Opacity Values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6