Skip to content

Instantly share code, notes, and snippets.

View garrickvanburen's full-sized avatar

Garrick van Buren garrickvanburen

View GitHub Profile
@garrickvanburen
garrickvanburen / wordpress_to_wind.rb
Created April 20, 2012 16:00 — forked from danieltamiosso/wordpress_to_wind.rb
Plugin to Wind for Wordpress importer
#
# Wind Wordpress Importer
#
# To install this plugin do you need copy the file to Wind plugins directory.
# An admin widget will be crated to import WordPress eXtended RSS file.
#
# This plugin use hurricane gem [http://github.com/danieltamiosso/hurricane],
# [gem install hurricane] to install it.
#
@garrickvanburen
garrickvanburen / expand_shortened_url
Created December 16, 2010 15:33
expand_shortened_url
def expand_shortened_url(url)
link = URI.parse(url)
if link && link.path
http = Net::HTTP.new(link.host, link.port)
check_header = nil
http.start{|web| check_header = web.head(link.path) }
return check_header['location'].to_s if check_header.code.match(/^3/)
else
return url
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script src="/javascripts/jquery.js?1234325018" type="text/javascript"></script>
<script src="/javascripts/jquery-ui.js?1234325018" type="text/javascript"></script>
<script src="/javascripts/jquery.jdMenu.js?1234542508" type="text/javascript"></script>
<script src="/javascripts/jquery.bgiframe.js?1234325018" type="text/javascript"></script>
<script src="/javascripts/jquery.positionBy.js?1234325018" type="text/javascript"></script>
#### NEWS_ITEMS/INDEX: JUST RENDERS LAYOUT ####
Processing NewsItemsController#show (for 127.0.0.1 at 2009-02-17 15:03:52) [GET]
Parameters: {"action"=>"show", "id"=>"index", "controller"=>"news_items"}
Website Columns (73.5ms) SHOW FIELDS FROM `websites`
Website Load (0.5ms) SELECT * FROM `websites` WHERE (`websites`.`domain_name` = 'pas.local') LIMIT 1
Restriction MET by pas_domain FOR `pas.local'
Publisher Columns (2.7ms) SHOW FIELDS FROM `publishers`
Publisher Load (0.4ms) SELECT * FROM `publishers` WHERE (`publishers`.`id` = 1) LIMIT 1
Access GRANTED by RULE {:directives=>{}, :block=>nil} FOR `publisher'
Rendering template within layouts/pas_domain