its pretty self-explanatory
syntax:
readweb /?
readweb h++p://website'com
readweb /install (adds it's self as a command prompt command for the logged on user)
tell me what u think and what u think about how it installs it self as a command prompt command, could it be done more efficiently some other way
it would be nice if someone would rate this too
im not allowed to post anything with website urls in it on here yet so in the code replace *http*:// and *https*:// with what theyre obviously supposed to be
syntax:
readweb /?
readweb h++p://website'com
readweb /install (adds it's self as a command prompt command for the logged on user)
tell me what u think and what u think about how it installs it self as a command prompt command, could it be done more efficiently some other way
it would be nice if someone would rate this too
im not allowed to post anything with website urls in it on here yet so in the code replace *http*:// and *https*:// with what theyre obviously supposed to be
Code
@set "self=%0"
goto :batch
NOTES
**********************************************************************************************
must have the file extension "bat" not "cmd" for it's install as a CommandPrompt
command for the currently logged in user function to be able to work
this is because to compensate for the complications of the batch-file 0th parameter
being a different value depending on weather the batch-file is started using explorer
or command prompt i wrote the install macro to work with the way the value is when
this batch-file gets ran from command prompt which does not include the batch-file's
file-extension in it's name (or the folder-path either)(this is on windows 8.1 as of 3/30/2016)
storeing the 0th parameter's value into a variable in the first line of the batch file and useing
that var instead is a vista compatability thing that idk if its been patched or not yet
**********************************************************************************************
:batch
@echo off
for /f "tokens=*" %%A in ('echo %self%') do set "commandname=%%~nA"
if "%1"=="/?" goto :help
if "%1"=="-?" goto :help
if "%1"=="" echo.type "%commandname% /?" for an explaination of how to use %commandname% & goto :end
if /I "%1"=="/install" goto :InstallAsCommandPromptCommand
if /I "%1"=="/add" goto :InstallAsCommandPromptCommand
set "targpage=%*"
if "%targpage:~0,7%"=="*http*://" goto :nxt
if "%targpage:~0,8%"=="*https*://" goto :nxt
set "targpage=*http*://%targpage%"
:nxt
set "HttpInteracter=%temp%\%random%.vbs"
echo.set readwebpage = wscript.getobject(wscript.arguments.item(0))>"%httpInteracter%"
echo.While readwebpage.readystate ^<^> "complete">>"%httpInteracter%"
echo.wscript.sleep "100">>"%httpInteracter%"
echo.wend>>"%httpInteracter%"
echo.wscript.echo readwebpage.documentelement.outerhtml>>"%httpInteracter%"
call cscript //nologo "%httpInteracter%" "%targpage%"
echo.>"%httpInteracter%"
move "%httpInteracter%" "%temp%\1.tmp" >nul
del /f /q "%temp%\1.tmp" >nul
goto :end
:InstallAsCommandPromptCommand
echo.
echo.installing %commandname% command-line command ...
set "AddedCommandsContainer=%userprofile%\AddedCommandLineCommands"
if not exist "%AddedCommandsContainer%" (
mkdir "%AddedCommandsContainer%"
attrib +h +s -r "%AddedCommandsContainer%"
reg add HKCU\Environment /v "PATH" /t "reg_sz" /d "%PATH%;%AddedCommandsContainer%" /f >nul
reg add HKCU\Environment /v "AddedCommandLineCommandsLocation" /t "reg_sz" /d "%AddedCommandsContainer%" /f >nul
)
copy /y "%commandname%.bat" "%AddedCommandsContainer%\%commandname%.bat" >nul
echo.
echo.
echo %commandname% has been added as a command-line command for the logged in user
echo.changes will take effect at next login
echo.
goto :end
:help
echo.
echo.
echo.--
echo.syntax: %commandname% *http*://website'com
echo.--
echo.
echo.discription: reads the source code of the targeted webpage.
echo.
echo.to add this command as a Command Prompt command for your user
echo.type: %commandname% /install
echo.
echo.
echo.NOTES:
echo.does support HTTPS protocol.
echo.
echo.as always with viewing the source code of a webpage
echo.you can only view client-side executed code ^(like html^)
echo.not server-side executed code ^(like php^)
echo.just like when you click "view page source code"
echo.in any web-browser
echo.
echo.many websites have blocked a method of checking the client-side
echo.executed code of their webpages that gets the exact text of the
echo.client-side executed code so this application uses a different
echo.method that can not be blocked but if the targeted webpage
echo.didn't add a closeing tag for certain HTML tags (such as ^</BODY^>
echo.and ^</HTML^>) into their client-side executed code this method
echo.of querying it adds those closing tags it self to the text it displays
echo.
echo.
:end

