exchange img link — Gist
如何將網頁文章中的連結直接變成圖片觀看 | 癮科技
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDrivesInSendToMenu"=dword:00000001
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(links[i]);
myHttpWebRequest.AllowAutoRedirect = false;
HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
Console.WriteLine(myHttpWebResponse.GetResponseHeader("Location"));
myHttpWebResponse.Close();
public static bool IsValidHttpUri(string uriString)
{
Uri test = null;
return Uri.TryCreate(uriString, UriKind.Absolute, out test) && test.Scheme == "http";
}
var entry=document.querySelector("div.entry-content");
entry.innerHTML=entry.innerHTML.replace(/(http:\/\/.*)<\/p>/g,"<a style=\"color:blue; text-decoration:underline;\" target=\"_blank\" href=\"$1\">$1</a>");
NOTE:使用inline css是因為行內套用(Inline) > 嵌入套用(Embed) > 外部連接套用(External Link)