Mechanize to follow meta refresh link - perl

How can I get Mechanize get() to follow a meta refresh link?
My get() call is returning:
<html>
<head>
</head>
<body text="#000000">
<META HTTP-EQUIV="refresh" CONTENT="0; URL=/TMP/4254358.41083527.html">
</body>
</html>
How can I cause the link to be followed?

You can use the plugin module WWW::Mechanize::Plugin::FollowMetaRedirect
Since you say that's not working for you, I suggest you use
$mech->follow_link(tag => 'meta');

Related

Redirect github default homepage to my own page

i have recently create a github page but the default homepage is always this auto-generated homepage
But I directly want to go to my actual webpage,is there anyway to do it?
You can see an example of Using meta refresh to create an instant client-side redirect: there is no space.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The Tudors</title>
<meta http-equiv="refresh" content="0;URL='http://thetudors.example.com/'" />
</head>
<body>
<p>This page has moved to a <a href="http://thetudors.example.com/">
theTudors.example.com</a>.</p>
</body>
</html>
But in your case, your index.html does work on my side, and does redirect to default.html.

anchor tag with href as other than http is not working while sending mail to gmail

I am using the smtp sendmail function, in the anchor <a> tag href attribute we have reference other than http:// ie something like below
transauth://some other data
but the gmail is not creating the hyperlink of transauth but creating of http://gmail.com ,Any solutions regarding this.
Gmail strips links that use custom uri schemas.
A work around however is that if you have a website somewhere you can host a simple redirect page that will redirect you to the correct schema.
This is a pretty bullet proof redirect here I copied from this answer to another question
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://example.com">
<script type="text/javascript">
window.location.href = "http://example.com"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='http://example.com'>link to example</a>
</body>
</html>

Minimum includes for Alfresco Share custom page?

I am creating a custom Share page that must have none of the Alfresco UI on it, but which still needs access to the Alfresco and YAHOO objects.
I have successfully created the page and caused it to open in a new tab, but I get errors that the Alfresco and YAHOO objects are undefined.
What are the minimum includes I must add to my Freemarker template to get access to those objects?
Update: I have gotten the Alfresco and YAHOO objects to load, but now am getting "Uncaught Error: extend failed, please check that all dependencies are included."
Here are the freemarker and javascript includes I've got so far, if it'll help:
<#import "import/alfresco-common.ftl" as common />
...
<script type="text/javascript" src="../scripts/ajax/yahoo/yahoo-min.js"> </script>
<script type="text/javascript" src="../scripts/ajax/yahoo/connection/connection-min.js"> </script>
<script type="text/javascript" src="../scripts/ajax/common.js"> </script>
<script type="text/javascript" src="../scripts/ajax/utilities/utilities.js"> </script>
<script type="text/javascript" src="../yui/yuiloader/yuiloader.js"> </script>
<script type="text/javascript" src="../js/alfresco.js"> </script>
Update 2: Based on the first answer, the first few lines of the template look like this and again yield Uncaught ReferenceError: YAHOO is not defined:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<region-id>head-resources</region-id>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<title></title>
<script>
var urlParams;
Update 3: I've reduced the source to the minimum necessary to demonstrate the problem. What follows next is the template component definition file, followed by the freemarker template itself. Definition:
<?xml version='1.0' encoding='UTF-8'?>
<page>
<title>iPad Viewer</title>
<title-id>page.iPad.title</title-id>
<description>iPad Viewer</description>
<description-id>page.iPad.description</description-id>
<template-instance>viewer-ipad</template-instance>
<authentication>user</authentication>
</page>
Freemarker template:
<html>
<body>
<div class="content">
<#region-id>head-resources</#region-id>
<script>
alert(YAHOO);
alert(Alfresco);
</script>
</div>
</body>
</html>
Error is:
Caused by: freemarker.core.ParseException: Parsing error in template "org/alfresco/viewer-ipad.ftl" in line 11, column 7: Unclosed #... when the end of the file was reached.
I'm not sure how you created the page, but this is not needed when you define your regions.
Probably there are all in the <region-id>head-resources</region-id> So if you include that in the page-template that should suffice.

Is my CDN or W3 Total Cache blocking the Facebook crawler?

Every new page I've added since yesterday (6) hasn't been able to pull data from the Facebook crawler. Debugger gives me Response code 200 and
error that must be fixed The 'og:type' property is required, but not present.
errors that should be fixed Inferred Property The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags.
Both of these are actually on the page.
Crawler tells me it's seeing this:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex,nofollow">
<script>
loooong token(?) information
</script>
</head>
<body>
<iframe style="display:none;visibility:hidden;" src="//content.incapsula.com/jsTest.html" id="gaIframe"></iframe>
</body>
</html>
I tried disabling/reenabling plugins that I've updated recently but that doesn't seem to d anything.
Ideas?

How to redirect affiliate outbound links without PHP or htaccess?

I want to redirect outbound affiliate links and on this site there is no option for PHP or htaccess.
So far I've always done this using
<?php
header( 'Location:' ) ;
?>
but like I said this is not an option anymore as this site does not support php or .htaccess anymore.
Is there an alternative solution for this, using HTML ?
Use this code before </head>
<meta http-equiv="refresh" content="0; url=http://youraffiliatelink.com/" />
use this hrml code in header of your page :
<meta http-equiv="refresh" content="0; url=http://example.com/" />
or use JavaScript like this :
<script type="text/javascript">
window.location.href = "http://example.com"
</script>