Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Oleksandr Danylchenko trianglesis

🎯
Focusing
View GitHub Profile
@trianglesis
trianglesis / python_decorator_guide.md
Created Jul 20, 2018 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)
View python_decorator_guide.md

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@trianglesis
trianglesis / del 100 posts per row
Last active May 11, 2018
Delete all posts on your own page on facebook Imacros
View del 100 posts per row
VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://www.facebook.com/<YOUR_ID_OF_PAGE>/allactivity?privacy_source=activity_log&log_filter=cluster_11
WAIT SECONDS=2
TAG POS=1 TYPE=A ATTR=data-tooltip-content:Дозволено<SP>в<SP>життєписі
TAG POS=2 TYPE=SPAN ATTR=TXT:Видалити
TAG POS=1 TYPE=BUTTON ATTR=TXT:Видалити<SP>допис
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=data-tooltip-content:Дозволено<SP>в<SP>життєписі
@trianglesis
trianglesis / #DelCommentRecursive.iim
Created May 11, 2018
iMacros browsed extension script for comment deletion loops on own Facebook timeline.
View #DelCommentRecursive.iim
VERSION BUILD=1001 RECORDER=CR
URL GOTO=https://www.facebook.com/PROFILE_ID_NAME_ETC/allactivity?privacy_source=activity_log&log_filter=cluster_116
WAIT SECONDS=5
TAG POS=1 TYPE=A ATTR=aria-label:Редагувати
TAG POS=1 TYPE=SPAN ATTR=TXT:Видалити
WAIT SECONDS=5
@trianglesis
trianglesis / vk_b-day.py
Created Jul 28, 2016
Старый скриптец, который я использовал около года назад для выборки именинников и публикации поста с ними на стену сообществ Вконтакте. Выкладываю в публичный доступ, так как морально он устарел и код в нем выглядит ужасно, но подходит чисто для образовательных целей и "авось кому пригодится" мне бы он помог на первых порах изучения, может быть …
View vk_b-day.py
#! /usr/bin/env python3
# coding=utf-8
__author__ = 'danilcha'
# Change history
# 2015-11-16 Add note about new API method after VK_module update, and new list parsing method.
import vk
from time import gmtime, strftime
curr_date = strftime("%Y-%m-%d")
@trianglesis
trianglesis / eachPost_getComments.vk
Created Jul 27, 2016
Get comments from each post. For vkontakte API execute.
View eachPost_getComments.vk
var myList = Args.post_id_array_str;
var listSeparator = ",";
var listItemsType = "integer";
var result = [];
var charsLength = myList.length;
var currentPosition = 0;
var previousSeparatorPosition = -1;
var item;
while (currentPosition < charsLength) {
if (myList.substr(currentPosition, 1) == listSeparator) {
@trianglesis
trianglesis / wall_getComments_parsed.vk
Created Jul 27, 2016
This script allows you to get all comments from post id array string.
View wall_getComments_parsed.vk
var comment;
var comment_id;
var comment_from_id;
var comment_date;
var comment_likes;
var comments_format;
var comments_list = [];
var myList = Args.post_id_array_str;
var listSeparator = ",";
View gist:8ed6075fa7105f5fabf2b23b822cbcfa
var myList = Args.post_id_array_str;
// List should end with separator, for exampe ","
// car myList = 111,222,333,444,
var listSeparator = ",";
var listItemsType = "integer";
var result = [];
var charsLength = myList.length;
var currentPosition = 0;
var previousSeparatorPosition = -1;
@trianglesis
trianglesis / GoogleAPI.py
Created Feb 3, 2016 — forked from SalvaJ/GoogleAPI.py
Example making HTTP request to use Google API without api-client.It works in Python3 (tested ok in 3.3.5)
View GoogleAPI.py
#!usr/bin/python3
# -*- coding: UTF-8 -*-
"""This module is a sample of the OAuth2 authentication by Python3"""
__version__ = "0.1.0"
__author__ = "shin (shin.hateblo.jp)"
__copyright__ = "(C) 2012 shin"
__email__ = "s2pch.luck@gmail.com"
__license__ = "Apache License 2.0"
@trianglesis
trianglesis / vk_random.py
Last active Jul 27, 2016
vkid-randomizer
View vk_random.py
'''
This script is used to parse some html file
where vk ids stored and then choose
one of them randomly and export it to csv file
1. Replaced error with charset by replace character
2. Change the way how print was formatted
2.1 Added random - used range from list of ids
3. Added CSV export tool for one man
'''