Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
fixed #48 #46
Browse files Browse the repository at this point in the history
  • Loading branch information
pishangujeniya committed Sep 6, 2021
1 parent 8f7b74b commit 855c565
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 49 deletions.
47 changes: 0 additions & 47 deletions InstagramHelperChrome.js

This file was deleted.

113 changes: 113 additions & 0 deletions InstagramHelperChrome.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
' MIT License

' Copyright (c) 2018 Pishangkumar Ujeniya

' Permission is hereby granted, free of charge, to any person obtaining a copy
' of this software and associated documentation files (the "Software"), to deal
' in the Software without restriction, including without limitation the rights
' to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
' copies of the Software, and to permit persons to whom the Software is
' furnished to do so, subject to the following conditions:

' The above copyright notice and this permission notice shall be included in all
' copies or substantial portions of the Software.

' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
' SOFTWARE.
' Option Explicit

Dim instagramHelperChromeDirectoryPath
Dim specialArguments
Dim desktopPath
Dim objShortcut
Dim objShell

Const shortCutFileName = "InstagramHelperChrome"
Const chromeInstalledPath = "C:\Program Files\Google\Chrome\Application\chrome.exe" '// Path to the Chrome.exe file installed in your Windows System.

instagramHelperChromeDirectoryPath = BrowseFolder("",False)

specialArguments = "--disable-web-security --disable-gpu --user-data-dir=""" & instagramHelperChromeDirectoryPath & """"

Set objShell = CreateObject("WScript.Shell")

desktopPath = objShell.SpecialFolders ("Desktop")
Set objShortcut = objShell.CreateShortcut (desktopPath & "\" & shortCutFileName & ".lnk")
objShortcut.TargetPath = chromeInstalledPath
objShortcut.WorkingDirectory = strWorkDir
objShortcut.Description = shortCutFileName
objShortcut.Arguments = specialArguments
objShortcut.Save

objShell.Popup("See Desktop, a new shortcut " & shortCutFileName & " is created")

WScript.Quit


Function BrowseFolder( myStartLocation, blnSimpleDialog )
' This function generates a Browse Folder dialog
' and returns the selected folder as a string.
'
' Arguments:
' myStartLocation [string] start folder for dialog, or "My Computer", or
' empty string to open in "Desktop\My Documents"
' blnSimpleDialog [boolean] if False, an additional text field will be
' displayed where the folder can be selected
' by typing the fully qualified path
'
' Returns: [string] the fully qualified path to the selected folder
'
' Based on the Hey Scripting Guys article
' "How Can I Show Users a Dialog Box That Only Lets Them Select Folders?"
' http://www.microsoft.com/technet/scriptcenter/resources/qanda/jun05/hey0617.mspx
'
' Function written by Rob van der Woude
' http://www.robvanderwoude.com
Const MY_COMPUTER = &H11&
Const WINDOW_HANDLE = 0 ' Must ALWAYS be 0

Dim numOptions, objFolder, objFolderItem
Dim objPath, objShell, strPath, strPrompt

' Set the options for the dialog window
strPrompt = "Select InstagramHelperTemp Folder :"
If blnSimpleDialog = True Then
numOptions = 0 ' Simple dialog
Else
numOptions = &H10& ' Additional text field to type folder path
End If

' Create a Windows Shell object
Set objShell = CreateObject( "Shell.Application" )

' If specified, convert "My Computer" to a valid
' path for the Windows Shell's BrowseFolder method
' If UCase( myStartLocation ) = "MY COMPUTER" Then
Set objFolder = objShell.Namespace( myStartLocation )
Set objFolderItem = objFolder.Self
strPath = objFolderItem.Path
' Else
' strPath = myStartLocation
' End If

Set objFolder = objShell.BrowseForFolder( WINDOW_HANDLE, strPrompt, _
numOptions, strPath )

' Quit if no folder was selected
If objFolder Is Nothing Then
' BrowseFolder = "NO DESTINATION PATH SELECTED"
Exit Function
End If

' Retrieve the path of the selected folder
Set objFolderItem = objFolder.Self
objPath = objFolderItem.Path

' Return the path of the selected folder
BrowseFolder = objPath
End Function
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ This JavaScript has helper methods to perform various tasks automation.
- Install [Chrome Browser](https://www.google.com/intl/en_in/chrome/)
- Open [https://github.com/pishangujeniya/instagram-helper/releases/](https://github.com/pishangujeniya/instagram-helper/releases/)
- Download latest release version (Source Code zip) and extract to desktop.
- Double click [InstagramHelperChrome.js](./InstagramHelperChrome.js) from the extracted folder. _(This js file is not to be run into browser or browser console, only need to double click and run with Windows Active Host)_
- Create an empty temporary folder somewhere.
- Double click [InstagramHelperChrome.vbs](./InstagramHelperChrome.vbs) from the extracted folder.
- Select that temporary created folder.
- That will then generate a Chrome Shortcut on your Desktop with name `InstagramHelperChrome`
- Open that Special Chrome Browser using that shortcut.
- Open that Special Chrome Browser using that shortcut. (Ignore the flag that says _You are using an unsupported comman-line flag: --disable-web-security. Stability and security will suffer_) (This flag is shown because we will be mimicking the automation process of Sending Request to Instagram using Chrome).
- Open [Instagram.com](https://instagram.com)
- Press `F12` (Developer Tools) or `Ctrl+Shift+I`

Expand Down

0 comments on commit 855c565

Please sign in to comment.