Bug 952316

Summary: [PATCH REVIEW] Add URL shortening support
Product: [Fedora] Fedora Reporter: Othman Madjoudj <athmanem>
Component: fpasteAssignee: Ankur Sinha (FranciscoD) <sanjay.ankur>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: athmanem, kevin, metherid, sanjay.ankur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-30 02:06:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
URL shortening patch
none
Fix shorturl with unescaped json in paste content none

Description Othman Madjoudj 2013-04-15 16:05:19 UTC
Created attachment 735965 [details]
URL shortening patch

Description of problem:

Fedora pastebin now supports url shortening via ur1.ca (foss service from Identi.ca).

This feature is not yet merged with sticky-notes (pull request already done), so the patch may conflicts with other patches (bz #865972).

I've attached a patch which displays the shortened URL instead of the long one.

Eg:

./fpaste
testing
1
2
3
Uploading (0.1KiB)...
http://ur1.ca/de7cb


http://ur1.ca/de7cb --> http://paste.fedoraproject.org/7517/66040894/

Comment 1 Ankur Sinha (FranciscoD) 2013-04-15 22:55:16 UTC
Hi Athmane,

I'll test the patch later today and let you know. Should I commit it to SCM and push a build if it works?

Thanks,
Ankur

Comment 2 Othman Madjoudj 2013-04-16 08:56:16 UTC
(In reply to comment #1)
> Hi Athmane,
> 
> I'll test the patch later today and let you know. Should I commit it to SCM
> and push a build if it works?

Yes, that's would be nice.

Thanks.

Comment 3 Othman Madjoudj 2013-04-17 10:59:22 UTC
Created attachment 736792 [details]
Fix shorturl with unescaped json in paste content

I've attached a fix to issue when json data can not be decoded because of unescaped json in paste content.

Comment 4 Ankur Sinha (FranciscoD) 2013-04-17 13:37:28 UTC
Hi Athmane, 

This seems to work correctly:

[ankur@ankur-pc  fpaste(master *%=)]$ fpaste --sysinfo
Gathering system info............................Uploading (14.4KiB)...
http://ur1.ca/df0vx -> http://paste.fedoraproject.org/7800/05559136
[ankur@ankur-pc  fpaste(master *%=)]$ fpaste --sysinfo -P no
Gathering system info............................Uploading (14.4KiB)...
http://ur1.ca/df0w5 -> http://paste.fedoraproject.org/7801
[ankur@ankur-pc  fpaste(master *%=)]$ fpaste --sysinfo -P no -U http://paste.stg.fedoraproject.org
Gathering system info............................Uploading (14.4KiB)...
http://ur1.ca/df0wd -> http://paste.stg.fedoraproject.org/4125
[ankur@ankur-pc  fpaste(master *%=)]$ fpaste --sysinfo -P no -U http://sites.sayakbanerjee.com/paste/
Gathering system info............................Uploading (14.4KiB)...
http://sites.sayakbanerjee.com/paste/1246
[ankur@ankur-pc  fpaste(master *%=)]$


Pushing to SCM and building. I've incorporated all the patches and cleaned them up.

Thanks,
Ankur

Comment 5 Ankur Sinha (FranciscoD) 2013-04-30 02:06:07 UTC
Looks like I forgot to add this to the update.