Skip to content

Commit

Permalink
Added a button in the instagram config wizard to open the link automa…
Browse files Browse the repository at this point in the history
…tically in the browser instead for instrcuting the user to copy paste it
  • Loading branch information
jkakavas committed Oct 19, 2015
1 parent f22796d commit 326c687
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions creepy/plugins/instagram/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
from configobj import ConfigObj

import pytz
from PyQt4.QtGui import QLabel, QLineEdit, QWizard, QWizardPage, QVBoxLayout, QMessageBox, QTextEdit
from PyQt4.QtGui import QLabel, QLineEdit, QWizard, QWizardPage, QVBoxLayout, QMessageBox, QTextEdit, QPushButton
from instagram.client import InstagramAPI
from models.InputPlugin import InputPlugin
from utilities import GeneralUtilities, QtHandler
import functools
import webbrowser
# set up logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand Down Expand Up @@ -163,6 +165,9 @@ def returnAnalysis(self, target, search_params):
logger.error("Error getting locations from instagram plugin")
return locations_list, None

def openLinkInBrowser(self, link):
webbrowser.open(link, new=1)

def runConfigWizard(self):
try:
api = InstagramAPI(client_id=self.options_string['hidden_client_id'],
Expand All @@ -182,9 +187,11 @@ def runConfigWizard(self):
inputLink = QLineEdit()
inputLink.setObjectName("inputLink")
labelLink = QLabel("Your token value:")
openInBrowserButton = QPushB
openInBrowserButton = QPushButton("Open in browser")
openInBrowserButton.clicked.connect(functools.partial(self.openLinkInBrowser, url))
layout1.addWidget(txtArea)
layout1.addWidget(urlArea)
layout1.addWidget(openInBrowserButton)
layout1.addWidget(labelLink)
layout1.addWidget(inputLink)
page1.setLayout(layout1)
Expand Down

0 comments on commit 326c687

Please sign in to comment.