TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

YC Apply Auto-Save Bookmarklet

2 pointsby nicholasreedabout 14 years ago
YC Apply Auto-save<p>Save the following Javascript as a bookmarklet.<p>javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g&#62;f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&#38;&#38;(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){var myRegExp = /ews.ycombinator.com/;var string1 = document.domain;var matchPos1 = string1.search(myRegExp);if(matchPos1 != 1){$('body').prepend("&#60;div class='autosaveBodyTopLeft' style='z-index:10000;position:fixed;top:0;left:0;width:auto;background:red;color:white;'&#62;You are not on the YC Apply page! (we think, but may be wrong here)&#60;/div&#62;");return;}$('body').prepend("&#60;div class='autosaveBodyTopLeft' style='position:fixed;top:0;left:0;width:auto;background:blue;color:white;'&#62;YC Apply Auto-save&#60;/div&#62;");var isKeypressed = 1;var isSaving = 0;var keyWas = 1;$('input').keypress(function(){isKeypressed = 1;keyWas = 1;});$('textarea').keypress(function(){isKeypressed = 1;keyWas = 1;});$('select').change(function(){isKeypressed = 1;keyWas = 1;});var lastPostData = {};window.setInterval(function(){if(isSaving){return;}if(isKeypressed == 0){if(keyWas == 0){return;}keyWas = 0;}var postData = {};$('input').each(function(index){postData[$(this).attr('name')] = $(this).val();});$('textarea').each(function(index){postData[$(this).attr('name')] = $(this).val();});$('select').each(function(index){postData[$(this).attr('name')] = $(this).find('option:selected').text();});tempPostData = JSON.stringify(postData);if(lastPostData == tempPostData){return;}lastPostData = tempPostData;var url = $('form').attr('action');isSaving = 1;$.ajax({url: url,cache: false,data: postData,type: 'post',dataType: 'html',success: function(responseHtml){isSaving = 0;isKeypressed = 0;}});},10000);});<p>When you are on the YC Apply page, click the bookmarlet you, or just copy/paste the Javascript into the URL.<p>It checks for new post data every 10 seconds, and updates if necessary.

no comments

no comments