itchat组件:https://github.com/littlecodersh/ItChat
下载后根据安装教程

pip install itchat

安装itchat
新建wxbot.py

#coding=utf8
import itchat
import time
@itchat.msg_register('Text')
def text_reply(msg):
  f = open("words.txt")  
  for line in f:
    splited = line.split(',')
    if splited[0] in msg['Text']:
      
阅读更多

jQuery垂直居中

if ($(".ClassName").height() = $(window).height()) $(".ClassName").css("marginTop",$(window).height()/2 - $(".ClassName").height()/2);

jQuery iframe高度自适应

$(document).ready(
  function()
  {
    $(window).resize(function(){$(".iframeName").height($(window).height());});
    $(".iframeName").load(function(){$(this).height($(window).height());});
  }
);
阅读更多

Post

function postData($url, $data)
{
$ch = curl_init();
$timeout = 300;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, ""); //来路
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
阅读更多