very hackish code - padma poster frames show on tooltip

This commit is contained in:
Sanj 2011-06-26 08:50:09 +05:30
parent 298cdf7911
commit de4e57728a
4 changed files with 509 additions and 4 deletions

View File

@ -3,13 +3,14 @@ from pyquery import PyQuery as pq
def do(): def do():
data = json.loads(open("radia.json").read()) data = json.loads(open("radia.json").read())
outfile = "padma.json" outfile = "padmaData.js"
ret = {} ret = {}
for d in data: for d in data:
# print get_padma_ids(data[d]['link']) # print get_padma_ids(data[d]['link'])
ret[d] = get_padma_ids(data[d]['link']) ret[d] = get_padma_ids(data[d]['link'])
f = open(outfile, "w") f = open(outfile, "w")
f.write(json.dumps(ret, indent=2)) f.write("PADMA = " + json.dumps(ret, indent=2))
# f.write(json.dumps(ret, indent=2))
f.close() f.close()
print "generated padma.json from radia.json - currently returns empty if link points to a single video. this should be fixed soon" print "generated padma.json from radia.json - currently returns empty if link points to a single video. this should be fixed soon"

View File

@ -6,7 +6,7 @@
<script type="text/javascript" src="jquery-1.6.1.min.js"></script> <script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jquery.tooltip.js"></script> <script type="text/javascript" src="jquery.tooltip.js"></script>
<script type="text/javascript" src="radia.js"></script> <script type="text/javascript" src="radia.js"></script>
<script type="text/javascript" src="padmaData.js"></script>
</head> </head>
<body> <body>
<!-- <!--

489
padmaData.js Normal file
View File

@ -0,0 +1,489 @@
PADMA = {
"Vir Sanghvi": [
"Vt8du9n4",
"Vi37j4ua",
"Vdxtzud8",
"Vhmudalp",
"Vev9ymm1",
"Vh5xa6vo",
"Vfs11gi2",
"Vef0ynwz",
"Vsaz3vls",
"Vsbb71h6",
"Vezuyfye",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vfb5rxms",
"Vu1bfkgs",
"Vgopxkto",
"Vuhwl68c",
"Vuhut0lb",
"Vum02zsv",
"Vfrzbbm7",
"Vej7h1ev",
"Vu11hgnz",
"Vulplp7m",
"Vu0o3aeu",
"Vs6u3q08",
"Vfgemnpn",
"Vg9cc3yr",
"Vg9c45xj"
],
"Ambani kids": [],
"MDA": [
"Ve2gcg3i",
"Vhmssu8i"
],
"Srinath Narasimhan": [
"Vsb6xajo"
],
"DMK": [],
"Airlines": [],
"Niira": [],
"Upender": [
"Vu5gpfjx"
],
"Sunil Arora": [
"Vt8du9n4",
"Vi37j4ua",
"Vdxtzud8",
"Vhmudalp",
"Vev9ymm1",
"Vh5xa6vo",
"Vfs11gi2",
"Vef0ynwz",
"Vsaz3vls",
"Vsbb71h6",
"Vezuyfye",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vfb5rxms",
"Vu1bfkgs",
"Vgopxkto",
"Vuhwl68c",
"Vuhut0lb",
"Vum02zsv",
"Vfrzbbm7",
"Vej7h1ev",
"Vu11hgnz",
"Vulplp7m",
"Vu0o3aeu",
"Vs6u3q08",
"Vfgemnpn",
"Vg9cc3yr",
"Vg9c45xj"
],
"Politicians": [],
"Kanimozhi": [
"Vfwznkw1",
"Ve2m6yt1",
"Vf00rydj",
"Vsnfhehm",
"Vgu2aqwr",
"Vhlysmbs",
"Vg984263"
],
"Ratan Tata": [
"Vt8du9n4",
"Vi37j4ua",
"Vdxtzud8",
"Vhmudalp",
"Vev9ymm1",
"Vh5xa6vo",
"Vfs11gi2",
"Vef0ynwz",
"Vsaz3vls",
"Vsbb71h6",
"Vezuyfye",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vfb5rxms",
"Vu1bfkgs",
"Vgopxkto",
"Vuhwl68c",
"Vuhut0lb",
"Vum02zsv",
"Vfrzbbm7",
"Vej7h1ev",
"Vu11hgnz",
"Vulplp7m",
"Vu0o3aeu",
"Vs6u3q08",
"Vfgemnpn",
"Vg9cc3yr",
"Vg9c45xj"
],
"Neucomm": [
"Vdxtzud8",
"Vsbb71h6",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vu1bfkgs",
"Vuhwl68c",
"Vej7h1ev",
"Vu0o3aeu",
"Vs6u3q08",
"Vg9cc3yr",
"Vgpvuhti",
"Veuq95rh",
"Vulnxnrb",
"Vsnvm87t",
"Vsbumd6x",
"Vs72282j",
"Vumdkuif",
"Vi7modqx",
"Vfwxvubl",
"Vs67zz75",
"Ve343jto",
"Vsmjxic1",
"Veeqwhvc",
"Ve303yut",
"Vhln336f",
"Vtor8pb2",
"Vg7wjdrm",
"Vsrq3lqu"
],
"Bharti Airtel - Tata": [],
"Rajathi Ammal": [
"Vi7gq03x"
],
"Journalists": [],
"Congress": [],
"Jehangir P.": [
"Vugwv7hs",
"Vulplp7m",
"Vtky32f5",
"Vsaz3vls",
"Vi37m00n"
],
"Maran": [
"Vhrfcj35",
"Vg98adu7",
"Vdx5vuok",
"Vumht31l",
"Vt3mpkdo",
"Vtkhzp6v",
"Vfs11gi2",
"Vuh8uq0h",
"Vdxtzud8",
"Vs684ai9",
"Vf011105",
"Ve2m6yt1",
"Vfsmvz4x",
"Vgp26fyf",
"Vgoq9ur1",
"Vi7mmuxl",
"Vt3h0gwo",
"Vs7c9giq",
"Vt8du9n4",
"Vf00rydj",
"Vsnfhehm",
"Vgu2aqwr",
"Vhlysmbs",
"Vg984263",
"Vfgry5sx",
"Vt8vbomn",
"Vgpvuj5u",
"Vi37j4ua",
"Vhaq2tyf",
"Vgdtbsgp"
],
"N.K.Singh": [
"Vu17a0xh",
"Vev9ymm1"
],
"Cabinet": [],
"Mention of,": [],
"Rahul Joshi": [
"Vgoe0e05"
],
"Surojeet": [
"Vh558qk7"
],
"R.K.Chandolia": [
"Vfs6zogw",
"Vgdh29ze",
"Vfb5rxms",
"Vt8du9n4"
],
"Prabhu Chawla": [
"Vi7oaxrw"
],
"News": [],
"Vaishnavi": [],
"ADAG": [],
"Sunil Mittal": [
"Vsbcsxd3",
"Vhmycwls",
"Vulnp66k",
"Vha3ta1q",
"Vumht31l",
"Vgoe0e05",
"Vezpca89",
"Vtky32f5",
"Vgtkauw1",
"Vt3mpkdo",
"Vsb6xajo",
"Vtkhzp6v",
"Vdxjeazm",
"Vdy5fcma",
"Vss7x8il",
"Vezuyfye",
"Vuh8uq0h",
"Vs684ai9",
"Vt3h0gwo",
"Vt8vbomn",
"Vgpvuj5u",
"Vi37j4ua"
],
"Karunanidhi": [
"Vi7gq03x",
"Vev9ymm1",
"Vs684ai9",
"Vgoq9ur1",
"Vt3h0gwo",
"Vg984263",
"Vt8vbomn",
"Vgpvuj5u",
"Vi37j4ua",
"Vhaq2tyf",
"Vgpppt5n",
"Vhmsi99z",
"Vu11d7or",
"Vhmii4i1",
"Vt2xiy1v",
"Vg86s594",
"Ve2u8crz"
],
"Rashmi": [
"Vdxjeazm"
],
"Corporates": [],
"Jaideep Bose": [],
"PMS Prasad": [
"Vt2yu6v1",
"Vu5u0vkk"
],
"Barkha Dutt": [
"Vt8du9n4",
"Vi37j4ua",
"Vdxtzud8",
"Vhmudalp",
"Vev9ymm1",
"Vh5xa6vo",
"Vfs11gi2",
"Vef0ynwz",
"Vsaz3vls",
"Vsbb71h6",
"Vezuyfye",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vfb5rxms",
"Vu1bfkgs",
"Vgopxkto",
"Vuhwl68c",
"Vuhut0lb",
"Vum02zsv",
"Vfrzbbm7",
"Vej7h1ev",
"Vu11hgnz",
"Vulplp7m",
"Vu0o3aeu",
"Vs6u3q08",
"Vfgemnpn",
"Vg9cc3yr",
"Vg9c45xj"
],
"Iron Ore": [],
"K.R. Raja": [
"Vtokxjml",
"Vgu8fj8r"
],
"Srini": [
"Vu07qhwb",
"Vulnxnrb"
],
"Praful Patel": [
"Vgdut8lb",
"Vh558qk7",
"Vee17zg1",
"Vejnhn3w",
"Vg98adu7",
"Vulnp66k",
"Vg9cc3yr",
"Vu5gpfjx",
"Vt8vbomn",
"Vulps59f"
],
"Vaishnavi/": [
"Vdxtzud8",
"Vsbb71h6",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vu1bfkgs",
"Vuhwl68c",
"Vej7h1ev",
"Vu0o3aeu",
"Vs6u3q08",
"Vg9cc3yr",
"Vgpvuhti",
"Veuq95rh",
"Vulnxnrb",
"Vsnvm87t",
"Vsbumd6x",
"Vs72282j",
"Vumdkuif",
"Vi7modqx",
"Vfwxvubl",
"Vs67zz75",
"Ve343jto",
"Vsmjxic1",
"Veeqwhvc",
"Ve303yut",
"Vhln336f",
"Vtor8pb2",
"Vg7wjdrm",
"Vsrq3lqu"
],
"Manoj W": [
"Vdynlpqy",
"Vt3wsjbb",
"Vgdorbph",
"Ve2gp3vh",
"Veed2k73",
"Vuh1cn08",
"Vt32y0dr",
"Vhaxonz1",
"Vu0o3aeu",
"Vhm4owum",
"Vej7h1ev",
"Vsrq3lqu",
"Ve303yut",
"Vg7wjdrm",
"Vuhwl68c",
"Vfwxvubl",
"Vs67zz75",
"Ve343jto",
"Vsmjxic1",
"Veeqwhvc",
"Vi7modqx",
"Vu1bfkgs",
"Vsbumd6x",
"Vs72282j",
"Vsn1qxbe",
"Vsnvm87t",
"Veuq95rh",
"Vgpvuhti"
],
"Nita": [],
"RNRL": [],
"PAA": [],
"Shobhaa De": [
"Vu07qhwb",
"Vulnxnrb",
"Vsnvm87t",
"Veuq95rh"
],
"TATA": [],
"Spectrum": [],
"R. Sridharan": [
"Vezpca89"
],
"Manoj Modi": [
"Vtoxber8",
"Vs6zz908",
"Vss7x8il",
"Vef0ynwz"
],
"Rajdeep S.": [
"Vg80l4p9"
],
"A.Raja": [
"Vuh8uq0h",
"Vf011105",
"Vs7c9giq",
"Vfgry5sx"
],
"Anil Ambani": [
"Vu17a0xh",
"Vsbcsxd3",
"Vhmycwls",
"Vgdorbph",
"Vi7u8o5y",
"Vev2c78m",
"Vgdnb76h",
"Vg98adu7",
"Vdy5uxcb",
"Vu001c2d",
"Vsru5iup",
"Vulnp66k",
"Vdx5vuok",
"Vg8opstn",
"Vi2vpcpz",
"Vha9rjqz",
"Vi7oaxrw",
"Vhm4owum",
"Vs6u3q08",
"Vuh8uq07",
"Vfwni7g7",
"Vha3ta1q",
"Vulplp7m",
"Vumht31l",
"Vsbmv13h",
"Vgoe0e05",
"Vezpca89",
"Vhajvcft",
"Vtky32f5",
"Ve303yut"
],
"Senthil": [
"Vfs70g93"
],
"Gas Issue": [],
"Sasan - Coal": [],
"Tarun Das": [
"Vt8du9n4",
"Vi37j4ua",
"Vdxtzud8",
"Vhmudalp",
"Vev9ymm1",
"Vh5xa6vo",
"Vfs11gi2",
"Vef0ynwz",
"Vsaz3vls",
"Vsbb71h6",
"Vezuyfye",
"Vsmrke3t",
"Vu07qhwb",
"Vhadr6jb",
"Vsn1qxbe",
"Vfb5rxms",
"Vu1bfkgs",
"Vgopxkto",
"Vuhwl68c",
"Vuhut0lb",
"Vum02zsv",
"Vfrzbbm7",
"Vej7h1ev",
"Vu11hgnz",
"Vulplp7m",
"Vu0o3aeu",
"Vs6u3q08",
"Vfgemnpn",
"Vg9cc3yr",
"Vg9c45xj"
],
"Issues": []
}

View File

@ -47,6 +47,7 @@ $(function() {
thisData = R[key]; thisData = R[key];
var $this = $(this); var $this = $(this);
// $this.data("r", thisData); // $this.data("r", thisData);
$this.data("key", key);
$this.data("name", thisData.name); $this.data("name", thisData.name);
$this.data("type", thisData.type); $this.data("type", thisData.type);
$this.data("link", thisData.link); $this.data("link", thisData.link);
@ -55,7 +56,11 @@ $(function() {
'delay': 0, 'delay': 0,
'showURL': false, 'showURL': false,
'bodyHandler': function() { 'bodyHandler': function() {
return $(this).data("name"); var html = "<div class='ttWrapper'>";
html += "<div class='tooltipName'>" + $(this).data("name") + "</div>";
html += "<div class='padmaPosters'>" + getPostersHTML(PADMA[$(this).data("key")]) + "</div>";
html += "</div>";
return html;
} }
}); });
$texts.push($this); $texts.push($this);
@ -103,3 +108,13 @@ $(function() {
}); });
}); });
function getPostersHTML(padma_ids) {
var limit = 1;
var html = '';
for (var i=0; i<padma_ids.length; i++) {
if (i>limit) { break; }
var posterLink = "http://pad.ma/" + padma_ids[i] + "/poster.png";
html += "<img src='" + posterLink + "' />";
}
return html;
}