How would i create a bookmarklet like the one provided with delicious - ruby-on-rails

So a user would add a "add bookmart to the website" bookmark on their bookmarks and when they click it, a page would open and it would take the URL of the website that they were on when they clicked the bookmark...
If it matters, i'm trying to build the website on Rails, and i'm in very beginning stages, and i just wanted some ideas on how i would go about doing this...

You need to make a link to the Delicious Add Bookmark URL. To look at the Addresses for all of the sites, check out this page.
Replace this URL with the relevant information:
http://del.icio.us/post?v=4&partner=[partner]&noui&url={url}&title={title}
Partner is Optional.

Related

Start a dowload from external link in Rails

I'm trying to write code in my controller download to start a download from some external url say www.abc.com/foo.mp4. So far I have built it this way:
def download
redirect_to 'www.abc.com/foo.mp4'
end
It works but the problem is that it opens a video in the same tab. What I want is that it should start a download in the browser of this video.
I searched about it in forums but couldn't find any solution. All I found was a way to download the video first using the URL and then provide it as download but that's not what I want. I want the download to start directly from the external URL.
I think this might help you: Download from a link with HTML5
In your case it would be:
download me
That way, from the same webpage you are, when the user clicks on it, it will start the download and you don't go throught the controller, but in case you want to go throught the controller "download" and then just render a page with some kind of information saying that is downloading or something else, then put that link I wrote above somewhere in that page (and if you want, you can give it a class name and with css hide that class so that link is not visible but it is there) and at the end a Javascript function that calls itself when it is loaded and performs the action of clicking to that link:
(function(){
$('#whateverIdYouGiveToTheHtmlElement').click();
})();
I should clarify that $('#whateverIdYouGiveToTheLink').click(); is jQuery and not pure Javascript, but since you are using Rails I assume the project has jQuery (by default Rails comes with jQuery).

Free and easy way to dynamically update/send text to released app via internet?

I would like to be able to send text to/update a Label in my App that is already released whenever I want to via Internet. It really just needs to be a little text, like one or two sentances.
I was doing a lot of research on how to achieve this.
Twitter - use a Twitter Account to post the text and get the post from inside the app ? - Just found solutions to read the user Account that is currently using the app (but should be my own account where i can post, and that post should be shown in the app to everybody) and need to be locked in Twitter in System preferences. If you want to read "foreign" account you need to integrate fabric - sign there... very complicated... !?
Podcast ?
Just get text from anywhere via NSURLSession - I have no Website to put the text on... !?
Use Restful Service ? Is there any free web service I can just write two sentences and they could get loaded into my app?
So I am not asking about how to implement NSURLSession or so, I just wonder what would be the easiest and free way to provide text somewhere in some format from where my app could download the text and update a label? I don t really want to pay for a service or a website just to write two sentances from time to time, from where I could download it into my app...
Thanks for ideas
One option would be to put a text file in a Github repo. Github provides a link to the raw file, so your app could pull from that URL.
If you want to do this through the web interface, you can follow these steps:
Create an account on github.com, and log in.
Click the plus (+) in the upper right to add a new repository.
Pick any name for "Repository name".
Check "Initialize this repository with a README". You need this to make it easy to edit online.
Click the green "Create repository" button.
Click "Create new file".
Fill in the file name.
Enter whatever text you want for your app in the body of the file.
Click the green "Commit" button at the bottom.
Whenever you want to edit the file, you can click on the file name and then click the pencil to edit it.
You can get the link to the file by clicking the "Raw" button (when viewing the file) and copying the URL from your URL bar. It should be something like https://raw.githubusercontent.com/<username>/<repo>/blob/master/<filename>.

How to protect the url from being copy and pasted

Hey guys do you know how I can implement this in Rails?
Lets say I hyperlink the word "Go here" with "www.example.com".
how can I protect the link so that nobody see and copy and paste and reuse the url I am using for "Go here".
I trying to make a link for business coupons and trying to make sure not anybody can copy and paste the url and use it.
You can't. You could try disabling right click, but that would just be annoying for your users.
Here's a way to do it: How do I disable right click on my web page?

Adobe Indesign SWF Export - Hyperlinks

I've been using Indesign to create some brochures. I export them as SWF to display them as a flip book.
The next step I want to take is to put hyperlinks on each product in my brochure so that when a user clicks them the item gets added to their shopping basket, or something similar.
First I tried using a hyperlink value of ?product=code, but as there's no http://, whenever you open this link it just opens a blank tab.
Secondly I tried a hyperlink value of http://linktosite.com/flipbook.php?product=code. This worked fine but as the users may want to order several products from the catalogue they're going to click on a lot of the links, which will in turn open up loads of new tabs in the browser.
My question is: Is there a way of passing hyperlink values through the same page the SWF is on? I don't want the links to open a new tab everytime.
How can I achieve this?
Indesign cs5.5 has new feature called 'web viewer'in windows/extensions/overlay creator. This let you browsing another website in indesign file.

Edit .doc in Word via custom Document Library DispForm.aspx

I have a document library with a workflow that dynamicly sets user permissions to edit these documents when certain criteria is met.
The users who need to edit these items are not the brightest users, so to make it failsafe and simple for them I am customizing the DispForm.aspx to only show 2 fields in the Document Library.
"Document" - Name of the document which is a link that opens the document in MS Word.
"Done?" - Yes/No tickbox.
The user gets an e-mail when they have a task assigned; the e-mail contains an URL to the custom DispForm.aspx, the user clicks the link and voila, they see the customized DispForm.aspx with only 2 fields, they know exactly what to do because they won't get distracted by an information-overdose and the only thing the user has to do is click on the document so it would open in Word, user makes changes to document, saves, ticks "yes" in the "Done?" tickbox and the next workflow starts.
Now I'm having this particular problem, when I customize the document library's DispForm.aspx in Sharepoint Designer and add a custom Sharepoint control (Custom Document Library listform) it does not contain the Name field (which contains the URL). I can manually add that link in Sharepoint Designer but then the document gets opened in the web version of Word and if the user wants to save it, it saves to the local harddrive, instead of the Document Library.
What am I doing wrong? How can I include the right URL to a document in a customized DispForm of a document library which opens the document in Word and saves to the Document library and creates a draft version?
Suggestions, tips or other solutions VERY welcome!
Erik
Currently using: MOSS 2007, Nintex, Sharepoint Designer
I wrote a blog on how to get an External Link for Editing a SharePoint Document. Maybe that can help.

Resources