How do I add a link to a stack/bundle using the Delicious API? - delicious-api

So, I've create a link with tag "test" on Delicious. Now I want to add the link to my "TestStack" stack/bundle/whatever using the Delicious API.
The documentation says you can do so using https://api.del.icio.us/v1/tags/bundles/set?:
Assign a set of tags to a single bundle, wipes away previous settings for bundle.
Okay, super. I tried this using cURL and the Ruby API; nothing happens, nothing at all. My links with tag "test" are still floating around, assigned to no bundles/stacks.
curl -u username:password "https://api.del.icio.us/v1/tags/bundles/set?bundle=TestStack&tags=test"
Any ideas how to make this work? Maybe this API method is meant for something different?

Turns out Delicious does not yet have support for assigning links to stacks/bundles via their API (I talked with them directly). However, you CAN create new links and assign them to stacks/bundles via email. From https://delicious.com/settings#mobile:
When you save a single link, you can also add comments, tags, set the
privacy and add the link to a stack by using C:, T:, P: and S: in the
email body. The subject field will be the Title of the link.
For example:
Subject: A cool link
http://mycoollink.com/
C: I love this link
T: cool links, my link
P: No
S: Cool Links

Related

How to access a reddit post using redditkit in ruby?

I have a reddit post link here:
https://www.reddit.com/r/dankmemes/comments/6m5k0o/teehee/
I wish to access the data of this post throught the redditkit API.
http://www.rubydoc.info/gems/redditkit/
I have tried countless times and the docs don't make too much sense to me. Can someone help show how to do this through the ruby console? Or even an implementation of this in rails would be really helpful!
Looking at the #comment method on the gem, it takes a comment_full_name and performs a GET to api/info.json with that parameter as an id (seen by viewing the source for that method). If we look at the reddit api for api/info the id parameter is a full name for the object with a link to what a full name is.
Following that link, a full name for a comment is
Fullnames start with the type prefix for the object's type, followed by the thing's unique ID in base 36.
and
type prefixes
t1_ Comment
So now we know the comment_full_name should be t1_#{comment's unique id} which appears to be 6m5k0o. Here, I'm unsure if that's already base36 or if they want you to convert that into base36 before passing it. Without seeing what all you've tried, I would say
client = RedditKit::Client.new 'username', 'password'
client.comment("t1_6m5k0o")
and if that doesn't work
client.comment("t1_#{'6m5k0o' base36 encoded}")
For questions like this, it would be nice to see some of your code and what you tried/results they gave. For all I know, you've already tried this and have a reason it didn't work for you.
I would test this out for you, but I don't have a reddit account for the gem to sign in with, this is just my guess glancing at the documentation.

create multiple 'view in app' links using Branch.io in index view

I'd like to create an index view which shows a list of items followed by a 'view in app' button to download data directly into the app.
Solution 1. [Not a sulution] I think deepviewcta call is appropriated to use in a single product page. It doesn't look like suitable in my case, because it has to call deepview before calling deepviewcta.
Solution 2. I'm trying to construct the URL directly using 'dynamic' deeplink. The documentation says any additional query param appended will shows up in the initSession callback, but it doesn't work for me.
the construct link looks like this:
https://bnc.lt/a/key_test_kkkkkkkkkkkkkkkkkkkkkkk?has_app=yes&channel=character&my_list_id=0c56c4bc-fac9-412a-be19-c0feefe30d29
what I got in the callback only has following data
"+clicked_branch_link" = 0;
"+is_first_session" = 0;
in the callback, other params are just missing, I got:
url NSURL * #"my-app://open?link_click_id=197576253652400385" 0x00007fad90d47450
Any Other Solutions?
It turns out I was using live key in ios App while using test key in server end. So solution 2 works now.
Also for anyone want to do the same thing. For regular Branch Links, it is not possible to stay on the same page as the Branch link was clicked from. they suggest adding a $after_click_url to the Link's data. This key will tell the system to route to a particular web address after the Branch Link has been clicked.
Thanks for branch.io's support, they responded very quickly.

Find youtube links on other pages

I want to create a php page, that finds things on other sites.
Well, lets give an example to make you understand. Lets say there is a website called "anwebsite.com" and it have an page called "anwebsite.com/page.php"
I want to create a php script that find in that link if there are any youtube links (from embed for example) in his source, and get it.
Example:
$thesitelink = ("http://anwebsite.com/page.php") ( Lets say I put the link mannualy in the php page)
Then, here should be some scrips to find if on that page are any youtube links. If there is at least on, it doesn't matter if there are many, its enought at least one then put the link in a varialbe like $theyoutubelink. Like this:
$theyoutubelink = http://www.youtube.com/watch?v=xxxxxxxx
So the input data is $thesitelink and the output should be an youtube link (if there is one on that page)
What you need is a spider/crawler + parser.
First things first:
- Use CURL to get all the source html from the website crawled.
- Use Regular Expressions to parse Youtube links (don't forget short url ones)
Do you have any code made already?

Can't get rid of "via" text for Twitter share button

I'm working in a Rails 3.1.8 app and I'm having a problem creating a Twitter share button that produces the text I want. Here is the erb code for the button:
Tweet
This button appears on a page that contains content produced by a particular user. Let's call the user "sam". The text this code produces to be shared on Twitter is:
[some_text] [url of current page] via #sam
I would like to remove the "via #sam", but I cannot figure out how. If I explicitly set data-via I can change the user that the "via" phrase refers to, but I cannot make it disappear.
This support page suggests that omitting the data-via tag should do the trick, but I have found that it does not.
I've searched around the app to try to find a place where this parameter is being set, but I haven't found anything. However, as I'm pretty green with Twitter stuff, I may not be searching for the right thing.
Thanks in advance for your help, and do let me know if I can provide additional info.
ADDENDUM: I've tried add setting data-via to various values, including false, "false", and "", as well as appending ?via= and analogous values to the share URL. Each of these attempts resulted in a bogus via phrase (e.g. "#false"), or a default to "#sam".
Maybe you have an old version of the Javascript being included or cached.
Taking examples from https://dev.twitter.com/docs/tweet-button works as expected when omitting the data-via attribute.
Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
Working example: http://jsbin.com/uxopur/2/

Google Apps Script, anchor creating a redirect when clicked

I'm creating a script that logs a user into a site. Everything works but for some reason when the user clicks on the link to go to their profile the link opens in a new window and at first redirects before going to the correct page.
For example:
The correct link is: https://sites.google.com/site/examplelehan/Jan_Moolman but the moment the link is clicked the link that is actually executed in the address bar changes to: http://www.google.com/url?q=https%3A%2F%2Fsites.google.com%2Fsite%2Fexamplelehan%2FJan_Moolman&sa=D&usd=2&usg=AFQjCNFXLLswDh2AWCBpYi54jNXxpZVGPQ
So it seems as if www.google.co.za is being pre-pended to the url. I've seen other posts as well but none of them seem to be offering working solutions. A few posts have said that this occurs when the link is created without the http:// prefix but I've tested that and the same problem occurs.
I've also tried using .createHTML in order to create the link but for some reason the link doesn't show, any other HTML I use seems to work so I guess that's why Google created the Anchor function.
Thank you in advance for your help.
In this issue tracker comment Eric Koleda suggested a workaround using UrlShortener Services . I tested it with your link (http://goo.gl/HRPfU) and it seems to be a working solution.
EDIT : to answer your comment, here is a working example :
function test(){
var shorturl=short('https://sites.google.com/site/examplelehan/Jan_Moolman');
Logger.log(shorturl);
}
//
function short(longurl){
var toShorten = UrlShortener.newUrl().setLongUrl(longurl);
var short = UrlShortener.Url.insert(toShorten).getId();
return short
}
note that this API has to be activated before it can be used (see docs)

Resources