Skip to content

Instantly share code, notes, and snippets.

#include <winsock2.h>
#include "resource.h"
#ifndef _DEBUG
#pragma comment(linker, "/entry:_WinMain /nodefaultlib /subsystem:windows /filealign:512 /stack:65536,65536")
#pragma comment(linker, "/merge:.data=.text /merge:.rdata=.text /section:.text,ewrx /ignore:4078")
#endif
#define OPTION_BOTH 1
#define OPTION_MODEM 2
#include <stdio.h>
#if defined(__unix__) || defined(__unix)
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <malloc.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/tcp.h>
#include <windows.h>
#include <commctrl.h>
#include <shlobj.h>
#include "resource.h"
#include "md5.h"
#ifndef _DEBUG
#pragma comment(linker, "/entry:_WinMain /nodefaultlib /subsystem:windows /filealign:512 /stack:65536,65536")
#pragma comment(linker, "/merge:.data=.text /merge:.rdata=.text /section:.text,ewrx /ignore:4078")
#endif
import os
import re
import sys
import csv
import shutil
import requests
import threading
import concurrent.futures
from glob import glob
from tqdm import tqdm
import os
import re
import sys
import csv
import shutil
# import pickle
import requests
import threading
import concurrent.futures
from glob import glob
# Extract data from the anuga.com downloaded pages and create a sophisticated CSV table
from bs4 import BeautifulSoup
import csv
from tqdm import trange
import re
page_first = 1
page_last = 7789
# Download over half a million HTML pages
# This script can be run multiple times simultaneously to increase download speed
import requests
import os
import portalocker
from bs4 import BeautifulSoup
import re
# import time
settings = {}
with open('settings_csv2.txt') as f:
lines = list(s.strip() for s in f.read().splitlines() if s.strip() != '')
assert lines[0] == '[main settings]'
assert lines[8] == '[dates]'
assert lines[11] == '[time ranges]'
for line in lines[1:7+1]:
x, y = line.split('=', 1)
import requests
from bs4 import BeautifulSoup
import re
with open('input.txt', encoding='utf-8') as f:
keywords = f.read().splitlines()
pattern = re.compile('|'.join(keywords), flags=re.IGNORECASE)
# Search data in a SQLite database, save it to the Excel file
import os
import sqlite3
from tqdm import tqdm
from datetime import datetime
from openpyxl import load_workbook
from openpyxl.styles import Font, PatternFill, Color, Border, Side, Alignment
database_file_name = 'TZ092005.db'