From 857f21eb327828391b747f0f08f04956860b6743 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sat, 11 Feb 2012 10:03:14 +0100 Subject: [PATCH] fpostit by Devlon Duthied added to utils --- util/fpostit/README | 8 +++ util/fpostit/fpostit.js | 11 +++ util/fpostit/fpostit.php | 129 ++++++++++++++++++++++++++++++++++ util/fpostit/friendika-32.png | Bin 0 -> 1593 bytes 4 files changed, 148 insertions(+) create mode 100644 util/fpostit/README create mode 100644 util/fpostit/fpostit.js create mode 100644 util/fpostit/fpostit.php create mode 100644 util/fpostit/friendika-32.png diff --git a/util/fpostit/README b/util/fpostit/README new file mode 100644 index 0000000000..39b7c57613 --- /dev/null +++ b/util/fpostit/README @@ -0,0 +1,8 @@ +fpostit + +original author: Devlon Duthied + +see his blog posting: +http://blog.duthied.com/2011/09/13/node-agnostic-friendika-bookmarklet/ + +original published at github https://github.com/duthied/Friendika-Bookmarklet diff --git a/util/fpostit/fpostit.js b/util/fpostit/fpostit.js new file mode 100644 index 0000000000..a6c75aba8f --- /dev/null +++ b/util/fpostit/fpostit.js @@ -0,0 +1,11 @@ +javascript: (function() { + the_url = 'http://testbubble.com/fpostit.php?url=' + encodeURIComponent(window.location.href) + '&title=' + encodeURIComponent(document.title) + '&text=' + encodeURIComponent('' (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text)); + a_funct = function() { + if (!window.open(the_url, 'fpostit', 'location=yes,links=no,scrollbars=no,toolbar=no,width=600,height=300')) location.href = the_url; + }; + if (/Firefox/.test(navigator.userAgent)) { + setTimeout(a_funct, 0) + } else { + a_funct() + } +})() \ No newline at end of file diff --git a/util/fpostit/fpostit.php b/util/fpostit/fpostit.php new file mode 100644 index 0000000000..491d81f6d6 --- /dev/null +++ b/util/fpostit/fpostit.php @@ -0,0 +1,129 @@ + + + + + + + + $content); + + // echo "posting to: $url
"; + + $c = curl_init(); + curl_setopt($c, CURLOPT_URL, $url); + curl_setopt($c, CURLOPT_USERPWD, "$username:$password"); + curl_setopt($c, CURLOPT_POSTFIELDS, $data); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); + $c_result = curl_exec($c); + if(curl_errno($c)){ + $error = curl_error($c); + showForm($error, $content); + } + + curl_close($c); + if (!isset($error)) { + echo ''; + } + + } else { + $error = "Missing account name and/or password...try again please"; + showForm($error, $content); + } + +} else { + showForm(null, $content); +} + +function showForm($error, $content) { + $username_cookie = $_COOKIE['username']; + $password_cookie = $_COOKIE['password']; + + echo << +

+ Friendika Bookmarklet

+ + +
+
+ Enter the email address of the Friendika Account that you want to cross-post to:(example: user@friendika.org)

+ Account ID:
+ Password:
+
+   $error +
+

+
+EOF; + +} +?> + + + \ No newline at end of file diff --git a/util/fpostit/friendika-32.png b/util/fpostit/friendika-32.png new file mode 100644 index 0000000000000000000000000000000000000000..61764bf20a35fb21995b667e9a5e25436685a8a7 GIT binary patch literal 1593 zcmV-92FCe`P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L03itg03ithOzq;@000HdNkli(P8=f+Y^Mqc1WDr}2vQk{QV2|+A}XxHfQrbj zRH(85xk;}eX_zVqV1$KI$q_6^imXtyL@uc%ce#(b_xvgD%Ji=M&inl5|IcfT zk+rnW~cVMU8ZZk781Awt_EiW&B7^A=0&%>nLiE=zTF-F`Y z?jnYe_L%k%19FkaK*b=2KJJkieXtuAdLjSn+z01=1918BWloebmi#Ot+6 zd};o$s8PJixiZ(PPAQm8s^ZmeF?Cdnz=xsAO(@FBVaF<-N=#qcy`!ug#n_pR3xd8mK3UKSz ze-_?6Il*+Li$cWY2shJyLy_ci0i--vac-j3Y_i#FQ=jYM?zlvBSqVZ}McY#^X#4s< zPrZ8T)J*laOG{I$YhS_Wkj&ZH*u~ zg0LtdDzsyb^#^N5deLU8S3bR>qYE$d)9;;xa7ct;qgt!*(277b#xPPckcsy828~XO z&Tf|&97!b$DHg11?OtGGYg+=U?e;FW|9wMW-EKqo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