diff --git a/README.md b/README.md
index 0e8e0ab3..c0df29a5 100644
--- a/README.md
+++ b/README.md
@@ -45,9 +45,8 @@ The table below identifies the services this tool supports and some example serv
| [Prowl](https://github.com/caronc/apprise/wiki/Notify_prowl) | prowl:// | (TCP) 443 | prowl://apikey
prowl://apikey/providerkey
| [Pushalot](https://github.com/caronc/apprise/wiki/Notify_pushalot) | palot:// | (TCP) 443 | palot://authorizationtoken
| [PushBullet](https://github.com/caronc/apprise/wiki/Notify_pushbullet) | pbul:// | (TCP) 443 | pbul://accesstoken
pbul://accesstoken/#channel
pbul://accesstoken/A_DEVICE_ID
pbul://accesstoken/email@address.com
pbul://accesstoken/#channel/#channel2/email@address.net/DEVICE
+| [Pushjet](https://github.com/caronc/apprise/wiki/Notify_pushjet) | pjet:// | (TCP) 80 | pjet://secret@hostname
pjet://secret@hostname:port
pjets://secret@hostname
pjets://secret@hostname:port
| [Pushed](https://github.com/caronc/apprise/wiki/Notify_pushed) | pushed:// | (TCP) 443 | pushed://appkey/appsecret/
pushed://appkey/appsecret/#ChannelAlias
pushed://appkey/appsecret/#ChannelAlias1/#ChannelAlias2/#ChannelAliasN
pushed://appkey/appsecret/@UserPushedID
pushed://appkey/appsecret/@UserPushedID1/@UserPushedID2/@UserPushedIDN
-| [Pushjet](https://github.com/caronc/apprise/wiki/Notify_pushjet) | pjet:// | (TCP) 80 | pjet://secret
pjet://secret@hostname
pjet://secret@hostname:port
pjets://secret@hostname
pjets://secret@hostname:port
Note: if no hostname defined https://api.pushjet.io will be used
-| [Pushjet](https://github.com/caronc/apprise/wiki/Notify_pushjet) | pjet:// | (TCP) 80 | pjet://secret
pjet://secret@hostname
pjet://secret@hostname:port
pjets://secret@hostname
pjets://secret@hostname:port
Note: if no hostname defined https://api.pushjet.io will be used
| [Pushover](https://github.com/caronc/apprise/wiki/Notify_pushover) | pover:// | (TCP) 443 | pover://user@token
pover://user@token/DEVICE
pover://user@token/DEVICE1/DEVICE2/DEVICEN
_Note: you must specify both your user_id and token_
| [Rocket.Chat](https://github.com/caronc/apprise/wiki/Notify_rocketchat) | rocket:// or rockets:// | (TCP) 80 or 443 | rocket://user:password@hostname/RoomID/Channel
rockets://user:password@hostname:443/Channel1/Channel1/RoomID
rocket://user:password@hostname/Channel
| [Slack](https://github.com/caronc/apprise/wiki/Notify_slack) | slack:// | (TCP) 443 | slack://TokenA/TokenB/TokenC/Channel
slack://botname@TokenA/TokenB/TokenC/Channel
slack://user@TokenA/TokenB/TokenC/Channel1/Channel2/ChannelN
diff --git a/apprise/plugins/NotifyPushjet/NotifyPushjet.py b/apprise/plugins/NotifyPushjet/NotifyPushjet.py
index 7258b477..cb9ddc94 100644
--- a/apprise/plugins/NotifyPushjet/NotifyPushjet.py
+++ b/apprise/plugins/NotifyPushjet/NotifyPushjet.py
@@ -43,9 +43,6 @@ class NotifyPushjet(NotifyBase):
# The default descriptive name associated with the Notification
service_name = 'Pushjet'
- # The services URL
- service_url = 'https://pushjet.io/'
-
# The default protocol
protocol = 'pjet'
@@ -66,21 +63,16 @@ class NotifyPushjet(NotifyBase):
Perform Pushjet Notification
"""
try:
- if self.user and self.host:
- server = "http://"
- if self.secure:
- server = "https://"
+ server = "http://"
+ if self.secure:
+ server = "https://"
- server += self.host
- if self.port:
- server += ":" + str(self.port)
+ server += self.host
+ if self.port:
+ server += ":" + str(self.port)
- api = pushjet.Api(server)
- service = api.Service(secret_key=self.user)
-
- else:
- api = pushjet.Api(pushjet.DEFAULT_API_URL)
- service = api.Service(secret_key=self.host)
+ api = pushjet.Api(server)
+ service = api.Service(secret_key=self.user)
service.send(body, title)
self.logger.info('Sent Pushjet notification.')
@@ -91,3 +83,28 @@ class NotifyPushjet(NotifyBase):
return False
return True
+
+ @staticmethod
+ def parse_url(url):
+ """
+ Parses the URL and returns enough arguments that can allow
+ us to substantiate this object.
+
+ Syntax:
+ pjet://secret@hostname
+ pjet://secret@hostname:port
+ pjets://secret@hostname
+ pjets://secret@hostname:port
+
+ """
+ results = NotifyBase.parse_url(url)
+
+ if not results:
+ # We're done early as we couldn't load the results
+ return results
+
+ if not results.get('user'):
+ # a username is required
+ return None
+
+ return results
diff --git a/test/test_pushjet_plugin.py b/test/test_pushjet_plugin.py
index 1ab0f00b..789d4844 100644
--- a/test/test_pushjet_plugin.py
+++ b/test/test_pushjet_plugin.py
@@ -38,9 +38,9 @@ TEST_URLS = (
('pjets://', {
'instance': None,
}),
- # Default query (uses pushjet server)
+ # You must specify a username
('pjet://%s' % ('a' * 32), {
- 'instance': plugins.NotifyPushjet,
+ 'instance': None,
}),
# Specify your own server
('pjet://%s@localhost' % ('a' * 32), {