How to protect the url from being copy and pasted - ruby-on-rails

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?

Related

Code that can look at open browser tabs and store the urls?

I am attempting to write a program that looks at the current browser you have open, goes through each tab, and copies and pastes each page's url into a notepad file.
I have no issue with writing the file; my main concern is that I can't find anything in any language that can look at the browser, sift through the tabs, and scrape the url.
Does anyone know if this would be possible, any code that might be able to help (in any language), or if something like this exists? I would appreciate anyone pointing me in the right direction.
The software I was looking for did not exist, so I created it. It's a chrome extension called Raincheck

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>.

Add-on for Submitting File from Clipboard

Is There A Browser-Add-on That Can Create A Temporary Txt File From My Clipboard And Populate The File Submit Dialog?
Guide for firefox:
Get the data from your clipboard with this: paste data from clipboard using document.execCommand("paste"); within firefox extension
Now you can either create a temporary file with something like OS.File: https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread
Or create a object with something like window.createObjectUrl.
Then assuming the file submit dialog is prompted by a html5 uploader, then you should just set value of that html5 dialog box there are other ways though too, like mozSetDataAt, mozSetFileArray etc, search github for these keywords shows excellent examples:
https://github.com/search?l=javascript&q=mozSetDataAt&type=Code&utf8=%E2%9C%93
https://github.com/search?l=javascript&q=mozSetFileArray&ref=searchresults&type=Code&utf8=%E2%9C%93
You might need to use the mimeType of application/x-moz-file not sure. Definitely experiement with it and share your solution, and ask for help along the way. This is fun stuff.
There are probably other smarter ways to attach into a input type=file, i was trying to do it the other week. I would also be interested if someone else could share some solutions to actually trick the file input element to think the native file dialog was actually used, maybe using XPCOM.

Adding a button in django !

I wanted to add buttons or a url adjacent to "ADD CUSTOMER" button as shown in the image. Please guide me regarding the same.Where should i be making the necessary changes ?
please find the image here >> http://img138.imageshack.us/img138/170/query.png
Thank you
You add buttons/make changes in the html file, or your CSS file if you have one. If you're using Django make the changes in the /templates directory of your project, its the directory that contains the html files.
In this case what you are looking at is the admin site. The templates for this are located somewhere like "python-path/lib/site-packages/django/contrib/admin/...", but you can override these templates in your project. I'm not sure how easy it is to do what you're trying to do, but you can see this link for more information.

How would i create a bookmarklet like the one provided with delicious

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.

Resources