#!/bin/python
# -*- coding: utf-8 -*-
"""
# 发送消息到钉钉
"""
import json
import time
import sys
import requests
# dingidng notification
class Dingding(object):
def __init__(self, access_token, content='', at_people=''):
self.access_token = access_token
self.content = content
self.at_people = at_people
def get_token(self):
'''
钉钉管理后台 : http://open-dev.dingtalk.com
'''
access_token = 'https://oapi.dingtalk.com/robot/send?access_token=%s' % self.access_token
return access_token
def send_dingding(self):
'''
access_token: 网站
content: 发送的内容
msgtype : 类型
'''
msgtype = 'text'
if self