Skip to content

Instantly share code, notes, and snippets.

@tanaikech
tanaikech / submit.md
Last active July 18, 2024 06:01
Parsing HTML using Google Apps Script

Parsing HTML using Google Apps Script

This is a sample script for parsing HTML using Google Apps Script. When HTML data is converted to Google Document, the HTML data can be parsed and be converted to Google Document. In this case, the paragraphs, lists and tables are included. From this situation, I thought that this situation can be used for parsing HTML using Google Apps Script. So I could came up with this method.

In the Sheet API, the HTML data can be put to the Spreadsheet with the PasteDataRequest. But unfortunately, in this case, I couldn't distinguish between the body and tables.

The flow of this method is as follows. In this sample script, the tables from HTML are retrieved.

Flow

@oguzserdar
oguzserdar / referrer-spam-blacklist
Last active August 29, 2015 14:22
Stop the referrer spam
# This blacklist is ready to use in your site's root htaccess file
# Banned websites and crawlers
SetEnvIfNoCase Referer "^http://([a-z0-9\-]+\.)*semaltmedia\.com(/|:|$)" banned
SetEnvIfNoCase Referer "^http://([a-z0-9\-]+\.)*100dollars-seo\.com(/|:|$)" banned
SetEnvIfNoCase Referer "^http://([a-z0-9\-]+\.)*12masterov\.com(/|:|$)" banned
SetEnvIfNoCase Referer "^http://([a-z0-9\-]+\.)*4webmasters\.org(/|:|$)" banned
SetEnvIfNoCase Referer "^http://([a-z0-9\-]+\.)*7makemoneyonline\.com(/|:|$)" banned
SetEnvIfNoCase Referer "^http://([a-z0-9\-]+\.)*acads\.net(/|:|$)" banned
@jnbn
jnbn / iller-array.php
Last active October 29, 2023 15:52
Türkiye Iller Array
<?php
$iller = array('','Adana', 'Adıyaman', 'Afyon', 'Ağrı', 'Amasya', 'Ankara', 'Antalya', 'Artvin',
'Aydın', 'Balıkesir', 'Bilecik', 'Bingöl', 'Bitlis', 'Bolu', 'Burdur', 'Bursa', 'Çanakkale',
'Çankırı', 'Çorum', 'Denizli', 'Diyarbakır', 'Edirne', 'Elazığ', 'Erzincan', 'Erzurum', 'Eskişehir',
'Gaziantep', 'Giresun', 'Gümüşhane', 'Hakkari', 'Hatay', 'Isparta', 'Mersin', 'İstanbul', 'İzmir',
'Kars', 'Kastamonu', 'Kayseri', 'Kırklareli', 'Kırşehir', 'Kocaeli', 'Konya', 'Kütahya', 'Malatya',
'Manisa', 'Kahramanmaraş', 'Mardin', 'Muğla', 'Muş', 'Nevşehir', 'Niğde', 'Ordu', 'Rize', 'Sakarya',
'Samsun', 'Siirt', 'Sinop', 'Sivas', 'Tekirdağ', 'Tokat', 'Trabzon', 'Tunceli', 'Şanlıurfa', 'Uşak',
'Van', 'Yozgat', 'Zonguldak', 'Aksaray', 'Bayburt', 'Karaman', 'Kırıkkale', 'Batman', 'Şırnak',
@Rarst
Rarst / r-debug.php
Last active November 10, 2024 09:42
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/