Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #546 // URL getter

Lua code - Snippet-to-snippet

_, _, url = (snippetTitle.."\n"..snippetText):find("(http://[^\r\n \t]+)")
if not url then
  error("No URL found in snippet "..snippetID)
end

text = loadURL(url)
print("Text length: "..#text)

create {type='nt', text=text, title='Contents of '..url..' for '..snippetID}

Author comment

e.g. for #2000303

test run  test run with input  download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #546
Snippet name: URL getter
Eternal ID of this version: #546/1
Text MD5: 6d7f856e34fa897426ef3eed68125679
Author: stefan
Category:
Type: Lua code - Snippet-to-snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-03-22 17:46:22
Source code size: 278 bytes / 9 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 881 / 197
Referenced in: [show references]