From 9e1a4572a58a52d75c52de5fe04045981fcea88e Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 25 Aug 2010 16:39:54 +0200 Subject: ul.to fetching, so.biz expire --- module/plugins/accounts/ShareonlineBiz.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py index 3d213557a..611fa759d 100644 --- a/module/plugins/accounts/ShareonlineBiz.py +++ b/module/plugins/accounts/ShareonlineBiz.py @@ -18,19 +18,26 @@ """ from module.plugins.Account import Account +from time import strptime, mktime +import re class ShareonlineBiz(Account): __name__ = "ShareonlineBiz" - __version__ = "0.1" + __version__ = "0.2" __type__ = "account" __description__ = """share-online.biz account plugin""" __author_name__ = ("mkaay") __author_mail__ = ("mkaay@mkaay.de") - #@TODO: account info def getAccountInfo(self, user): + req = self.core.requestFactory.getRequest(self.__name__, user) + src = req.load("https://www.share-online.biz/alpha/user/profile") + + validuntil = re.search(r"Account gültig bis:.*?(.*?)", src).group(1) + validuntil = int(mktime(strptime(validuntil, "%m/%d/%Y, %I:%M:%S %p"))) + out = Account.getAccountInfo(self, user) - tmp = {"validuntil":None, "trafficleft":-1} + tmp = {"validuntil":validuntil, "trafficleft":-1} out.update(tmp) return out -- cgit v1.2.3