From d672f39930cea45e87222dce5e860bddfb8d92c5 Mon Sep 17 00:00:00 2001 From: hoergen Date: Fri, 24 Nov 2017 22:11:57 +0100 Subject: [PATCH 1/2] Bookmarklet for sharing links to friendica --- util/bookmarklet-share2friendica/README.md | 46 +++++++++++++++++++ .../bookmarklet-share2friendica.js | 1 + 2 files changed, 47 insertions(+) create mode 100644 util/bookmarklet-share2friendica/README.md create mode 100644 util/bookmarklet-share2friendica/bookmarklet-share2friendica.js diff --git a/util/bookmarklet-share2friendica/README.md b/util/bookmarklet-share2friendica/README.md new file mode 100644 index 000000000..013363072 --- /dev/null +++ b/util/bookmarklet-share2friendica/README.md @@ -0,0 +1,46 @@ +# Bookmarklet-share2friendica + +Javascript bookmarklet to share websites with your friendica account + +## Getting Started + +### Installing + +Open the file bookmarklet-share2friendica.js and change 'YourFriendicaDoomain.tld" with your friendica domain + +If you friendica is at https://myfriend.myfami.ly/ , the original ... +```javascript +javascript:(function(){f='https://YourFriendicaDomain.tld/bookmarklet/?url='+encodeURIC.... +``` +... has to be changed to ... + +```javascript +javascript:(function(){f='https://myfriend.myfami.ly/bookmarklet/?url='+encodeURIC.... +``` + +*Please copy the whole script, not only the part mentioned here!* + + +## Additional notes if it doesn't work + +* Make sure the site you want to share is allowed to run javascript. (enable it in your script blocker) +* Check the apostrophes that are used. Sometimes it is changed by the copy and paste process depending on the editor you are using, or if you copy it from a website. Correct it and it will work again. + + + +## Authors + +* **diaspora** - *Initial work* - [Share all teh internetz!](https://share.diasporafoundation.org/about.html) +* **hoergen** - *Adaptation to Friendica (2017)* - [hoergen.org](https://hoergen.org) + +## License + +This project is licensed under the same license like friendica + +## Acknowledgments + +* Hat tip to anyone who's code was used +* Hat tip to everyone who does everyday a little something ot make this world better +* Had tip but spent it + + diff --git a/util/bookmarklet-share2friendica/bookmarklet-share2friendica.js b/util/bookmarklet-share2friendica/bookmarklet-share2friendica.js new file mode 100644 index 000000000..584dee240 --- /dev/null +++ b/util/bookmarklet-share2friendica/bookmarklet-share2friendica.js @@ -0,0 +1 @@ +javascript:(function(){f='https://YourFriendicaDomain.tld/bookmarklet/?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title);a=function(){if(!window.open(f+'&jump=doclose','friendica','location=yes,links=no,scrollbars=no,toolbar=no,width=620,height=250'))location.href=f+'jump=yes'};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})() From d7f0c08bce12d09bbf4c4ade2fe9768ae554fd80 Mon Sep 17 00:00:00 2001 From: hoergen Date: Sat, 25 Nov 2017 01:49:18 +0100 Subject: [PATCH 2/2] Added Description for creating a bookmark --- util/bookmarklet-share2friendica/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/util/bookmarklet-share2friendica/README.md b/util/bookmarklet-share2friendica/README.md index 013363072..ad30baa9d 100644 --- a/util/bookmarklet-share2friendica/README.md +++ b/util/bookmarklet-share2friendica/README.md @@ -20,6 +20,7 @@ javascript:(function(){f='https://myfriend.myfami.ly/bookmarklet/?url='+encodeUR *Please copy the whole script, not only the part mentioned here!* +Then create a new bookmark, give it a name like "share2Friendica" and paste the script in the address field. Save it. Now you can click on that bookmarklet every time you want to share a website, you are currently reading. A new small window will open where title is prefilled and the website you want to share is put as attachement in the body of the new post. ## Additional notes if it doesn't work