Skip to content

Instantly share code, notes, and snippets.

@gotoplanb
gotoplanb / Lake City realtors
Created December 8, 2010 19:20
table scraper
#!/usr/bin/env python
from urllib import unquote
import csv
from mechanize import Browser
from BeautifulSoup import BeautifulSoup
mech = Browser()
url = "http://g8rweb.com/scrapers/lakecityagents.html"
page = mech.open(url)
html = page.read()
@gotoplanb
gotoplanb / poynter custom search
Created November 2, 2010 14:15
code for Google Custom Search form and results as iframe
<style>
#welcome {
position: relative;
width: 220px;
margin-top: 5px;
}
#welcome .search input, #welcome .search button {
border: none;
float: left;
<!--Begin - BMP Zone-->
<script language="javascript" type="text/javascript">
<!--
var browName = navigator.appName;
var SiteID = 1;
var ZoneID = 68;
var browDateTime = (new Date()).getTime();
if (browName=='Netscape')
{
@gotoplanb
gotoplanb / tracking scripts
Created October 25, 2010 20:59
For about and training Poynter microsites.
<html>
<head>
<!-- for both about and training -->
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
</head>
<body>
<!-- CRAZYEGG-->
<div id="jobs">
<h3>Latest Jobs</h3>
<ul id="jobs-listings">
<? SimplePie RSS list items. Feeds are in a comment tied to the to-do in Basecamp ?>
<li class="last">More Jobs</li>
</ul> <!-- END #jobs-listings -->
<ul id="jobs-links">
<li><a href="http://careers.poynter.org/jobseekers/profile/" target="_blank">Submit a Resume</a></li>
<li><a href="http://careers.poynter.org/post.cfm" target="_blank">Post your job</a></li>
<li><a href="https://poynter.site-ym.com/store/view_product.asp?id=290586" target="_blank">Become a member</a></li>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Poynter skin</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="wrapper" class="container_16">
<div id="leaderboard">
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Poynter skin</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="wrapper" class="container_16">
<div id="leaderboard">
<!-- Rip out what you need. This code goes in site templates. -->
<!DOCTYPE html>
<html>
<head>
<style>
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
.clear {
</div> <!-- END #wrapper -->
<div id="wrapper-footer"><div class="container_16">
<div id="footer-copyright" class="grid_4">
<p>&copy; 2010 The Poynter Institute</p>
</div>
<div id="footer-contact" class="grid_3">
<ul>
<li><a href="#">Foo</a></li>
<li><a href="#">Foo</a></li>