Ejemplo n.º 1
0
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<title>AutoFeed</title>
<meta name="robots" content="noindex,nofollow,noarchive" />
<?php 
echo link_tag('favicon.ico', 'shortcut icon', 'image/ico');
echo link_tag('imgs/favicon.ico', 'shortcut icon', 'image/ico');
echo link_tag('css/style.css');
?>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '<?php 
echo get_ga_code();
?>
', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="wrapper">
Ejemplo n.º 2
0
 private function test_utility_helper()
 {
     $this->unit->use_strict(true);
     $this->unit->run(get_github_url(), 'is_string', 'get_github_url()');
     $this->unit->run(get_facebook_url(), 'is_string', 'get_facebook_url()');
     $this->unit->run(get_twitter_url(), 'is_string', 'get_twitter_url()');
     $this->unit->run(get_google_map_key(), 'is_string', 'get_google_map_key()');
     $this->unit->run(get_ga_code(), 'is_string', 'get_ga_code()');
     $this->unit->run(is_null_or_empty_string(''), 'is_true', 'is_null_or_empty_string()');
     $this->unit->run(is_null_or_empty_string('test'), 'is_false', 'is_null_or_empty_string()');
     $this->unit->run(is_null_or_empty_string(1), 'is_false', 'is_null_or_empty_string()');
     $this->unit->run(start_with('abcdef', 'ab'), 'is_true', 'start_with()');
     $this->unit->run(start_with('abcdef', 'cd'), 'is_false', 'start_with()');
     $this->unit->run(start_with('abcdef', 'ef'), 'is_false', 'start_with()');
     $this->unit->run(start_with('abcdef', ''), 'is_true', 'start_with()');
     $this->unit->run(start_with('', 'abcdef'), 'is_false', 'start_with()');
     $this->unit->run(end_with("abcdef", "ab"), 'is_false', 'end_with()');
     $this->unit->run(end_with("abcdef", "cd"), 'is_false', 'end_with()');
     $this->unit->run(end_with("abcdef", "ef"), 'is_true', 'end_with()');
     $this->unit->run(end_with("abcdef", ""), 'is_true', 'end_with()');
     $this->unit->run(end_with("", "abcdef"), 'is_false', 'end_with()');
     $this->unit->run(get_domain_name('http://somedomain.co.uk'), 'somedomain.co.uk', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www2.manager.co.th'), 'manager.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://test.manager.co.th'), 'manager.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://manager.co.th'), 'manager.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://thaiware.com'), 'thaiware.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.thaiware.com'), 'thaiware.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://test.thaiware.com'), 'thaiware.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th/'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th/dasdasdasd.html'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th?quewadsas=2faddasdas'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.studentloan.ktb.co.th/2011/20/01?=asdasdasdasd'), 'ktb.co.th', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://pantip.com/forum/siam'), 'pantip.com', 'get_domain_name()');
     $this->unit->run(get_domain_name('http://www.wegointer.com/category/variety/'), 'wegointer.com', 'get_domain_name()');
     $this->unit->run(get_domain_name(), 'lab.jojoee.com', 'get_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.wegointer.com/category/variety/'), 'www.wegointer.com', 'get_domain_name()');
     $this->unit->run(get_full_domain_name('http://somedomain.co.uk'), 'somedomain.co.uk', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www2.manager.co.th'), 'www2.manager.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://test.manager.co.th'), 'test.manager.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://manager.co.th'), 'manager.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://thaiware.com'), 'thaiware.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.thaiware.com'), 'www.thaiware.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://test.thaiware.com'), 'test.thaiware.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th/'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th/dasdasdasd.html'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th?quewadsas=2faddasdas'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.studentloan.ktb.co.th/2011/20/01?=asdasdasdasd'), 'www.studentloan.ktb.co.th', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://pantip.com/forum/siam'), 'pantip.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name('http://www.wegointer.com/category/variety/'), 'www.wegointer.com', 'get_full_domain_name()');
     $this->unit->run(get_full_domain_name(), 'lab.jojoee.com', 'get_full_domain_name()');
     $url = 'http://sub.wegointer.com/category/variety/';
     $this->unit->run(get_request_url($url, get_full_domain_name($url)), '/category/variety', 'get_request_url()');
     $url = 'http://www.wegointer.com/category/variety/';
     $this->unit->run(get_request_url($url, get_full_domain_name($url)), '/category/variety', 'get_request_url()');
     $this->unit->run(get_full_url(), 'http://lab.jojoee.com/nn/test', 'get_full_url()');
     // 404, 301
     // $this->unit->run(is_url_exists('http://jojoee.com/404'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://fashion.spokedark.tv/2015/04/24/dichan-magazine/'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://www.jojoee.com/'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://test4041.com/'), 'is_false', 'is_url_exists()');
     // $this->unit->run(is_url_exists('http://test4041.com/'), 'is_false', 'is_url_exists()');
     // $this->unit->run(is_url_redirects('http://www.jojoee.com/'), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_404('http://jojoee.com/404'), 'is_true', 'is_404()');
     // $url = 'http://fashion.spokedark.tv/?p=6600';
     // $this->unit->run(is_url_exists($url), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_redirects($url), 'is_true', 'is_url_redirects()');
     // don't know why it doesn't work
     // $url = 'http://movies.spokedark.tv?p=10054/';
     // $this->unit->run(is_url_exists($url), 'is_true', 'is_url_exists()');
     // $this->unit->run(is_url_redirects($url), 'is_true', 'is_url_redirects()');
     $this->unit->run(get_extension('file.jpeg'), 'jpeg', 'get_extension()');
     $this->unit->run(get_extension('file.bk.zip'), 'zip', 'get_extension()');
     $this->unit->run(remove_trailing_slash('/category/product/'), '/category/product', 'remove_trailing_slash()');
     $this->unit->run(remove_trailing_slash('/category/product'), '/category/product', 'remove_trailing_slash()');
     $this->unit->run(remove_trailing_slash('category/product/'), 'category/product', 'remove_trailing_slash()');
     for ($i = 0; $i < 20; $i++) {
         $urls = $this->get_posts();
         foreach ($urls as $url) {
             $this->unit->run($url['is_publish'], '0', 'get_posts()');
         }
     }
 }