Add function to convert an URI to an url that can be shared and opened with lbry-app #27

Merged
dan1d merged 2 commits from share-link-uri into master 2018-05-30 16:19:15 +02:00
dan1d commented 2018-05-21 19:25:37 +02:00 (Migrated from github.com)

This function will parse a lbry URI and convert it to an https protocol, Let me know if this is the correct place to add it, we may need to use it on lbry-android sometime(tap on a video to share an url or something like that)
This PR is needed for PR on lbry-app#1486
So for example given this URI:
lbry://why-doesn-t-capitalism-work-for#36cd5b217bcc4083a6fc35cc4de2cc1196581ef9
changes to:
https://open.lbry.io/why-doesn-t-capitalism-work-for#36cd5b217bcc4083a6fc35cc4de2cc1196581ef9

This function will parse a lbry URI and convert it to an https protocol, Let me know if this is the correct place to add it, we may need to use it on lbry-android sometime(tap on a video to share an url or something like that) This PR is needed for [PR on lbry-app#1486](https://github.com/lbryio/lbry-app/pull/1486) So for example given this URI: `lbry://why-doesn-t-capitalism-work-for#36cd5b217bcc4083a6fc35cc4de2cc1196581ef9` changes to: `https://open.lbry.io/why-doesn-t-capitalism-work-for#36cd5b217bcc4083a6fc35cc4de2cc1196581ef9`
neb-b (Migrated from github.com) reviewed 2018-05-21 19:25:37 +02:00
tzarebczan commented 2018-05-21 23:44:44 +02:00 (Migrated from github.com)

@dan1d nice touch, this could be super useful to add as a share LBRY URL button in the app!

@dan1d nice touch, this could be super useful to add as a share LBRY URL button in the app!
neb-b commented 2018-05-22 17:08:30 +02:00 (Migrated from github.com)

@skhameneh

@skhameneh
dan1d commented 2018-05-22 23:02:07 +02:00 (Migrated from github.com)

@tzarebczan thanks, let me know if you may want that button I'm happy to work on it!

@tzarebczan thanks, let me know if you may want that button I'm happy to work on it!
skhameneh (Migrated from github.com) reviewed 2018-05-23 07:41:41 +02:00
skhameneh (Migrated from github.com) commented 2018-05-23 07:41:40 +02:00

Do you need these split out?
Seems like you can just do:

+  return buildURI(
+    parseURI(URI),
+    true,
+    'https://open.lbry.io/'
+  );
Do you need these split out? Seems like you can just do: ``` + return buildURI( + parseURI(URI), + true, + 'https://open.lbry.io/' + ); ```
dan1d commented 2018-05-23 20:20:55 +02:00 (Migrated from github.com)

Code updated @skhameneh

Code updated @skhameneh
skhameneh (Migrated from github.com) approved these changes 2018-05-24 05:04:14 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-redux#27
No description provided.