Skip to content

Instantly share code, notes, and snippets.

@morrah
morrah / sms_forward.py
Last active September 26, 2018 14:08
qpython script for sms forwarding
# TODO: subscribe SMS_RECEIVED_ACTION instead of polling
import androidhelper
import sys
from time import sleep
FORWARD_TO = '+79218887766'
LIMIT = 3
counter = 0
droid = androidhelper.Android()
@morrah
morrah / instadump
Created August 23, 2018 03:23
dumps direct links to pic/video inside every post of chosen user
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
from datetime import datetime
import ssl
import urllib
import urllib2
import json
import re
-- sqlite >= 3.3.8 required due to 'create ... if not exists ...'
CREATE TRIGGER IF NOT EXISTS update_messages AFTER UPDATE ON Messages
BEGIN
INSERT INTO Messages
SELECT (SELECT CAST(max(id) AS INTEGER) from Messages)+1,
new.is_permanent,
new.convo_id,
new.chatname,
new.author,
new.from_dispname,
@morrah
morrah / huikach_parser.py
Created December 19, 2012 11:41
2ch.hk parser provides Thread- and Post-classes output
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re, urllib, urllib2
from cookielib import CookieJar, DefaultCookiePolicy
class WebPage:
DEFAULT_HEADERS = {
"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.13) Gecko/20100914 Firefox/3.5.13",