Skip to content

Instantly share code, notes, and snippets.

View jerlendds's full-sized avatar
💭
🦷🧵🦾

jerlendds jerlendds

💭
🦷🧵🦾
  • Private
  • Cyberspace
View GitHub Profile
@jerlendds
jerlendds / get_cse_set.py
Last active August 26, 2021 00:08
Retrieve all CSE links from a start.me webpage by passing in the page id
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from typing import List
import requests
import json
def get_startme_links(page_ids: List[str] = None):
if page_ids is None:
raise ValueError(f"expected list of start.me ids, received: {page_ids}")
from dataclasses import dataclass
@dataclass
class HexCode(str):
hex: str
def rgb(self):
hex_string = self.hex.lstrip('#')
lv = len(hex_string)
return tuple(int(hex_string[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))
#!/usr/bin/python
# -*- coding: utf-8 -*-
# tuic - textual user interface controller
# Experiments With Curses | 2021, July 17
# I'm currently working on writing a simple TUI for a web crawler
# that supports scraping and analyzing anything you want to write a plugin for.
# This file creates two windows and draws boxes around the created windows
# The windows respond to the terminal resizing and the terminal display will be redrawn to reflect the new size
# KNOWN ISSUES: When terminal size becomes too small the program crashes
import requests
class PlacesAutocomplete:
"""https://developers.google.com/maps/documentation/places/web-service/autocomplete?hl=id
Args:
components (str) : expects country code e.g. country:ca
place_types (str) : e.g. (cities)
key (str) : Google Places autocomplete API key