pip install telethon
pip install aiohttp
import asyncio
from telethon import TelegramClient, events
from aiohttp import web
session_name = 'test'
api_id = 6
api_hash = 'eb06d4abfb49dc3eeb1aeb98ae0f581e'
async def main_userbot():
client = TelegramClient(session_name, api_id, api_hash)
@client.on(events.NewMessage(pattern='(?i)hellox'))
async def handler(event):
print(event.stringify())
await event.respond('Hi admin!')
await client.start()
me = await client.get_me()
print(me.stringify())
await client.run_until_disconnected()
async def main_web():
app = web.Application()
routes = web.RouteTableDef()
@routes.get('/')
@routes.get('/{name}')
async def handle(request):
name = request.match_info.get('name', "Anonymous")
print('get from ' + name)
text = "Hello, " + name
return web.Response(text=text)
app.add_routes(routes)
runner = web.AppRunner(app)
await runner.setup()
site = web.TCPSite(runner, host='0.0.0.0', port=8000)
await site.start()
print('running web server...')
await asyncio.Event().wait()
async def main():
await asyncio.gather(
main_userbot(),
main_web(),
)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
$url = 'https://www.kinopoisk.ru/';
$options = [
'http' => [
'method' => 'GET',
'header' => 'user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36'
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false
]
];
$context = stream_context_create($options);
$resp = file_get_contents($url, false, $context);
foreach($http_response_header as $c => $h) {
if(stristr($h, 'content-encoding') and stristr($h, 'gzip')) {
$resp = gzinflate(substr($resp, 10, -8));
break;
}
}
Dim arrData(5)
arrData(0) = Array(1, 10, 100)
arrData(1) = Array(2, 20, 200)
arrTmp = arrData(1)
ReDim Preserve arrTmp(9)
arrData(1) = arrTmp
MsgBox UBound(arrData(1)) ' 9
wscript.exe C:\test\ScanInvis.vbs C:\test\ScanInvis.bat /StiDevice:%1 /StiEvent:%2
sUrl = "http://coverlib.com/Download/1729291/The_Prodigy-The_Fat_Of_The_Land_UK-Front-.JPG"
sPath = "C:\Test\cover.jpg"
With CreateObject("Microsoft.XMLHTTP")
.Open "GET", sUrl, False
.Send
aContent = .ResponseBody
End With
With CreateObject("ADODB.Stream")
.Type = 1 ' adTypeBinary
.Open
.Write aContent
.SaveToFile sPath, 2 ' adSaveCreateOverWrite
.Close
End With
Option Explicit
Dim sSrc, oWB, oProp
With CreateObject("Excel.Application")
.Visible = False
.DisplayAlerts = False
For Each sSrc in WScript.Arguments
On Error Resume Next
Set oWB = .Workbooks.Open(sSrc)
On Error Goto 0
If .Workbooks.Count > 0 Then
For Each oProp In oWB.BuiltinDocumentProperties
oProp.Value = Empty
Next
.UserName = " "
oWB.Save
oWB.Close
End If
Next
.Quit
End With
CreateObject("WScript.Shell").PopUp "Completed", 1, , 64
WshShell.Run "cmd.exe /c read.cmd " & driveleter(ii), 0, false
dim completed
msgbox inputboxml("Enter text:", "Multiline inputbox via HTA", "default" & vbcrlf & vbtab & "multiline" & vbcrlf & "text")
function inputboxml(prompt, title, defval)
set window = createwindow()
completed = 0
defval = replace(replace(replace(defval, "&", "&"), "<", "<"), ">", ">")
with window
with .document
.title = title
.body.style.background = "buttonface"
.body.style.fontfamily = "consolas, courier new"
.body.style.fontsize = "8pt"
.body.innerhtml = "<div><center><nobr>" & prompt & "</nobr><br><br></center><textarea id='hta_textarea' style='font-family: consolas, courier new; width: 100%; height: 580px;'>" & defval & "</textarea><br><button id='hta_cancel' style='font-family: consolas, courier new; width: 85px; margin: 10px; padding: 3px; float: right;'>Cancel</button><button id='hta_ok' style='font-family: consolas, courier new; width: 85px; margin: 10px; padding: 3px; float: right;'>OK</button></div>"
end with
.resizeto 700, 700
.moveto 100, 100
end with
window.hta_textarea.focus
set window.hta_cancel.onclick = getref("hta_cancel")
set window.hta_ok.onclick = getref("hta_ok")
set window.document.body.onunload = getref("hta_onunload")
do until completed > 0
wscript.sleep 10
loop
select case completed
case 1
inputboxml = ""
case 2
inputboxml = ""
window.close
case 3
inputboxml = window.hta_textarea.value
window.close
end select
end function
function createwindow()
rem source http://forum.script-coding.com/viewtopic.php?pid=75356#p75356
dim signature, shellwnd, proc
on error resume next
signature = left(createobject("Scriptlet.TypeLib").guid, 38)
do
set proc = createobject("WScript.Shell").exec("mshta ""about:<head><script>moveTo(-32000,-32000);</script><hta:application id=app border=dialog minimizebutton=no maximizebutton=no scroll=no showintaskbar=yes contextmenu=no selection=yes innerborder=no icon=""%windir%\system32\notepad.exe""/><object id='shellwindow' classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'><param name=RegisterAsBrowser value=1></object><script>shellwindow.putproperty('" & signature & "',document.parentWindow);</script></head>""")
do
if proc.status > 0 then exit do
for each shellwnd in createobject("Shell.Application").windows
set createwindow = shellwnd.getproperty(signature)
if err.number = 0 then exit function
err.clear
next
loop
loop
end function
sub hta_onunload
completed = 1
end sub
sub hta_cancel
completed = 2
end sub
sub hta_ok
completed = 3
end sub