Skip to content

Instantly share code, notes, and snippets.

function nseQuotePuller(pblock,args){
var baseUrl = "http://www.nseindia.com/marketinfo/companyinfo/companysearch.jsp";
var params = {cons: Utils.trim(args.object.text),section:7};
jQuery.get( baseUrl, params, function( resp ) {
var begindex=resp.indexOf("/marketinfo/equities/cmquote_tab.jsp");
var searchresult=resp.indexOf("<font class=header3>Search Results</font>");
var noResult = resp.indexOf("<font class=contenttext>Click <a href=javascript:history.back()>here</a> to search again</font>");
if(begindex==-1 && searchresult==-1){
return;
}
@shivprasad
shivprasad / google.dictionary.user.js
Created July 18, 2011 09:18
A simple userscript which looks up selected word on google dictionary and alerts its meaning.
// ==UserScript==
// @name Google Dictionary
// @namespace http://byteco.de
// @include *
// ==/UserScript==
var t = '';
function gText(e) {
t = (document.all) ? document.selection.createRange().text : document.getSelection();
t = t.replace(/^\s+|\s+$/g,"");
@shivprasad
shivprasad / gist:4701503
Created February 3, 2013 11:57
Shell script to download trailers from http://hd-trailers.net. This script will download 480p trailers from Yahoo,Movifone and Apple. I started out from this script: http://majjix.com/2008/10/13/luke/automatically-downloading-quicktime-trailers-and-posters
#!/bin/bash
GETHD=1
GETPOSTER=1
KEEPDAYS="1365"
SAVEROOT="/media/Nexon/Trailers"
SAVEPATH="/media/Nexon/Trailers/hd-trailer."
DLDBPATH="/home/pi/"
FEEDS="http://feeds.hd-trailers.net/hd-trailers?format=xml"