Skip to content

Instantly share code, notes, and snippets.

View Netcelal's full-sized avatar

Celal Basar Netcelal

View GitHub Profile
@Netcelal
Netcelal / FindLinks.php
Created May 26, 2012 14:55 — forked from zachbrowne/FindLinks.php
Find Out All Links In any Website using PHP
@Netcelal
Netcelal / dom_scraper.php
Created May 26, 2012 15:03 — forked from gati/dom_scraper.php
Quick scrape using simple_html_dom
include('simple_html_dom.php'); // DOM parsing library.
$url = (isset($_GET['site'])) ? $_GET['site'] : 'http://www.yelp.com'; //just an example, clean this
$dom = file_get_html($url);
foreach ($dom->find('a') as $node) {
// Replace href attribute value
$node->href = 'http://YOURPROXYSERVER.COM?requestedurl='.urlencode($url.$node->href);
}
// Output modified DOM
echo $dom->outertext;
@Netcelal
Netcelal / DomHelper
Created May 26, 2012 15:03
PHP class for parsing html and get links
<?php
class helper {
//---------------------------------------------------------------------------
public function __construct() {
}
@Netcelal
Netcelal / mini-scrape.php
Created May 26, 2012 15:04 — forked from ChrisMcKee/mini-scrape.php
Small part of a php page scraping application
<?php
function get_web_page( $url,$curl_data )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
@Netcelal
Netcelal / gist:2794267
Created May 26, 2012 15:08 — forked from paulirish/gist:366184
html5 geolocation with fallback.
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
;(function(geolocation){
if (geolocation) return;
var cache;
@Netcelal
Netcelal / index.html
Created May 26, 2012 15:10 — forked from dennisschipper/index.html
Html5 starter kit
<!doctype html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="styles.css">
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<div id="wrapper">
@Netcelal
Netcelal / gist:2816412
Created May 27, 2012 23:42 — forked from mikemorris/gist:2654086
PHP script to scrape links from HTML files
<?php
$links = shell_exec('egrep -o -r "<a[^<]+?(\w*)</a>" --include=*.html *');
$output;
foreach(preg_split("/(\r?\n)/", $links) as $line){
$file = explode(':', $line)[0];
preg_match('/(?<=href=")[^"]+?(?=")/', $line, $url_matches);
$url = $url_matches[0];
@Netcelal
Netcelal / gist:2939360
Created June 16, 2012 00:31 — forked from thehydroimpulse/gist:2872907
A Laravel task generator. Models, Migrations and Controllers.
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/
.transparent {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Netscape */
-moz-opacity: 0.5;
@Netcelal
Netcelal / transparent.css
Created June 23, 2012 18:42
Cross-Browser Opacity
.transparent {
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */
filter: alpha(opacity=50);
/* Netscape */
-moz-opacity: 0.5;