You are not logged in.
Pages: 1
Hi!
Can I rename files with html canonical or shortlink tag?
Offline
Meta tags also will be usefull.
For e.g.:
<link rel="canonical" href=" " />
<link rel="shortlink" href=" " />
<meta property="og:site_name" content=" " />
<meta property="og:type" content="article" />
<meta property="og:url" content=" " />
<meta property="og:updated_time" content="2015-01-05T13:56:36+04:00" />
<meta property="og:image" content=" " />
<meta property="article:published_time" content="2012-01-20T17:00:36+04:00" />
<meta property="article:modified_time" content="2015-01-05T13:56:36+04:00" />
Offline
You can extract anything you want using a PascalScript rule.
For example, the code below extracts the content of <TITLE> HTML tag.
const
REGEX_PATTERN = '<title>(.*?)</title>';
var
Content: WideString;
Matches: TStringsArray;
begin
Content := UTF8Decode(FileReadContent(FilePath));
Matches := SubMatchesRegEx(Content, REGEX_PATTERN, False);
if Length(Matches) > 0 then
FileName := Matches[0];
end.
It can be easily modified to extract any other portion of HTML file by changing the REGEX_PATTERN constant.
Note: The code assumes that the HTML file uses UTF-8 encoding, hence, the use of UTF8Decode function.
Offline
Thanks, I will try it.
Offline
Pages: 1