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

14
LINES

< > BotCompany Repo | #1023829 // loadPageAndStore_once - load page and store in a file derived from URL, or get from disk

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3495L/24K).

sS loadPageAndStore_once(S url) {
  File f = defaultPlaceForStoredWebPage(url);
  if (f.exists()) ret loadTextFile(f);
  S page;
  try {
    page = loadPage(url);
  } catch e {
    print(e);
    page = "ERROR: " + e;
  }
  saveTextFile(f, page);
  saveTextFile(replaceExtension(f, ".url"), url);
  ret page;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1023829
Snippet name: loadPageAndStore_once - load page and store in a file derived from URL, or get from disk
Eternal ID of this version: #1023829/4
Text MD5: 8647b37502832afe399ea71065daa7f5
Transpilation MD5: 323320f663193f3aa99c9b2b3d88a62c
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-11 12:54:57
Source code size: 322 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 273 / 388
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1023839 - storedWebPage - get contents of stored web page (or null)