Skip to content

Instantly share code, notes, and snippets.

@bootell
bootell / telethon.py
Last active July 30, 2021 08:20
使用云函数自动发送telegram
# -*- coding: utf-8 -*-
import time
from telethon import TelegramClient, events, sync
from telethon.sessions import StringSession
api_id = [111] #输入api_id,一个账号一项
api_hash = ['xxx'] #输入api_hash,一个账号一项
session = ['xxx']
@bootell
bootell / wepush.php
Last active August 11, 2021 07:00
企业微信推送消息
<?php
class Wework
{
const CORPID = '';
const CORPSECRET = '';
const AGENTID = 1000002;
protected $_access_token;
<?php
error_reporting(0);
function get_raw_url($url)
{
$parse = parse_url($url);
return 'https://raw.githubusercontent.com' . $parse['path'] . '/master/readme.md';
}
function getData($object)
#!/usr/bin/python2
# -*- coding:utf-8 -*-
import requests
import time
import hashlib
from Crypto.Cipher import AES
import base64
import json
{"AF":["Afghanistan","93"],"AL":["Albania","355"],"DZ":["Algeria","213"],"AS":["AmericanSamoa","1684"],"AD":["Andorra","376"],"AO":["Angola","244"],"AI":["Anguilla","1264"],"AG":["Antigua and Barbuda","1268"],"AR":["Argentina","54"],"AM":["Armenia","374"],"AW":["Aruba","297"],"AU":["Australia","61"],"AT":["Austria","43"],"AZ":["Azerbaijan","994"],"BS":["Bahamas","1242"],"BH":["Bahrain","973"],"BD":["Bangladesh","880"],"BB":["Barbados","1246"],"BY":["Belarus","375"],"BE":["Belgium","32"],"BZ":["Belize","501"],"BJ":["Benin","229"],"BM":["Bermuda","1441"],"BT":["Bhutan","975"],"BA":["Bosnia and Herzegovina","387"],"BW":["Botswana","267"],"BR":["Brazil","55"],"IO":["British Indian Ocean Territory","246"],"BG":["Bulgaria","359"],"BF":["Burkina Faso","226"],"BI":["Burundi","257"],"KH":["Cambodia","855"],"CM":["Cameroon","237"],"CA":["Canada","1"],"CV":["Cape Verde","238"],"KY":["Cayman Islands","345"],"CF":["Central African Republic","236"],"TD":["Chad","235"],"CL":["Chile","56"],"CN":["China","86"],"CX":["Christma
@bootell
bootell / Versional.php
Created November 10, 2016 06:08
PHP程序自动获取版本号(git hash or file's modified time)
<?php
namespace bootell\models;
class Versional
{
/**
* Get git hash
*
* @param int $num
@bootell
bootell / tuicoolMags.py
Created April 21, 2016 06:25
tuicool magazines for kindleEar
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import re
from bs4 import BeautifulSoup
from base import BaseFeedBook, URLOpener, feedparser, string_of_tag
def getBook():
return tuicoolMags