Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4f6ead

Browse files
committed
Implemented xr.com service.
1 parente1e3032 commitd4f6ead

File tree

4 files changed

+67
-13
lines changed

4 files changed

+67
-13
lines changed

‎README‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Supported URL shortening services for shrinking long urls:
3535
to.ly
3636
budurl.com
3737
kl.am
38+
xr.com
3839

3940
Shorty can expand any url service by getting the redirect
4041
location by requesting the tiny url.

‎TODO‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ API available and ready to go!
66
+ adjix.com
77
+ metamark.net (xrl.us)
88
+ idek.net
9-
+ xr.com
109
+ easyuri.com
1110
+ rubyurl.com
1211
+ hurl.ws

‎services/xr.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## Shorty
2+
## Copyright 2009 Joshua Roesslein
3+
## See LICENSE
4+
5+
## @url xr.com x.bb
6+
classXr(Service):
7+
8+
def__init__(self,account_name=None):
9+
self.account_name=account_name
10+
11+
defshrink(self,bigurl,custom=None,domain=None,direct=True):
12+
parameters= {'link':bigurl}
13+
ifcustom:
14+
parameters['custom']=custom
15+
ifdomain:
16+
parameters['domain']=domain
17+
ifdirect:
18+
parameters['direct']='yes'
19+
ifself.account_name:
20+
parameters['pid']=self.account_name
21+
resp=request('http://api.xr.com/api',parameters)
22+
url=resp.read()
23+
ifurl.startswith('http'):
24+
returnurl
25+
else:
26+
raiseShortyError(url)
27+

‎shorty.py‎

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,31 @@ def shrink(self, bigurl, tag=None, password=None, expires=None):
522522

523523
agd=Agd()
524524

525+
# xr
526+
classXr(Service):
527+
528+
def__init__(self,account_name=None):
529+
self.account_name=account_name
530+
531+
defshrink(self,bigurl,custom=None,domain=None,direct=True):
532+
parameters= {'link':bigurl}
533+
ifcustom:
534+
parameters['custom']=custom
535+
ifdomain:
536+
parameters['domain']=domain
537+
ifdirect:
538+
parameters['direct']='yes'
539+
ifself.account_name:
540+
parameters['pid']=self.account_name
541+
resp=request('http://api.xr.com/api',parameters)
542+
url=resp.read()
543+
ifurl.startswith('http'):
544+
returnurl
545+
else:
546+
raiseShortyError(url)
547+
548+
xr=Xr()
549+
525550
# shortto
526551
classShortto(Service):
527552

@@ -684,26 +709,28 @@ def expand(self, tinyurl):
684709
bukme=Bukme()
685710

686711
services= {
687-
'a.gd':agd,
712+
'chilp.it':chilpit,
713+
'bit.ly':bitly,
688714
'short.to':shortto,
689-
'budurl.com':budurl,
690-
'digg.com':digg,
691-
'kl.am':klam,
692-
'tweetburner.com':tweetburner,
693715
'tr.im':trim,
694716
'twurl.nl':tweetburner,
717+
'buk.me':bukme,
718+
'fon.gs':fongs,
695719
'to.ly':toly,
720+
'fwd4.me':fwd4me,
721+
'xr.com':xr,
722+
'short.ie':shortie,
723+
'sandbox.com':sandbox,
724+
'a.gd':agd,
725+
'digg.com':digg,
726+
'kl.am':klam,
727+
'tweetburner.com':tweetburner,
728+
'budurl.com':budurl,
696729
'cli.gs':cligs,
697730
'urlborg.com':urlborg,
698731
'is.gd':isgd,
699-
'fon.gs':fongs,
700-
'chilp.it':chilpit,
701732
'ub0.cc':urlborg,
733+
'x.bb':xr,
702734
'tinyurl.com':tinyurl,
703-
'bit.ly':bitly,
704-
'fwd4.me':fwd4me,
705-
'short.ie':shortie,
706-
'sandbox.com':sandbox,
707-
'buk.me':bukme,
708735
}
709736

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp