GmailのRSSフィードからのランダムな署名は、真に動的な署名に使用できますか?

StackOverflow https://stackoverflow.com/questions/142319

  •  02-07-2019
  •  | 
  •  

質問

これは、Gmailラボの新しい機能で、RSSフィードを指定して、ランダムな引用符を取得してメール署名に追加できます。それを使用して、渡すパラメーター、現在の時刻などに基づいてプログラムで署名を生成したいと思います(たとえば、マケインとオバマが勝ち、イントレードのAPIから取得した現在の確率を追加する松のスクリプトがあります。以下を参照してください。)しかし、Gmailは指定したURLのコンテンツをキャッシュしているようです。それを制御する方法、またはGmailがURLを参照する頻度を知っている人はいますか?

追加:これをテストするために使用しているプログラムを次に示します。このファイルは、 http://kibotzer.com/sigs.php にあります。ここから取られたキャッシュなしヘッダーのアイデア- http://mapki.com/wiki/Dynamic_XML-役に立たないようです。

<?php

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
//XML Header
header("content-type:text/xml");
?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91">
<channel>
<title>Dynamic Signatures</title>
<link>http://kibotzer.com</link>
<description>Blah blah</description>
<language>en-us</language>
<pubDate>26 Sep 2008 02:15:01 -0000</pubDate>
<webMaster>dreeves@kibotzer.com</webMaster>
<managingEditor>dreeves@kibotzer.com (Daniel Reeves)</managingEditor>
<lastBuildDate>26 Sep 2008 02:15:01 -0000</lastBuildDate>

<image>
<title>Kibotzer Logo</title>
<url>http://kibotzer.com/logos/kibo-logo-1.gif</url>
<link>http://kibotzer.com/</link>
<width>120</width>
<height>60</height>
<description>Kibotzer</description>
</image>

<item>
<title>
Dynamic Signature 1 (<?php echo gmdate("H:i:s"); ?>) 
</title>
<link>http://kibotzer.com</link>
<description>This is the description for Signature 1 (<?php echo gmdate("H:i:s"); ?>) </description>
</item>

<item>
<title>
Dynamic Signature 2 (<?php echo gmdate("H:i:s"); ?>) 
</title>
<link>http://kibotzer.com</link>
<description>This is the description for Signature 2 (<?php echo gmdate("H:i:s"); ?>) </description>
</item>

</channel>
</rss>
--
http://ai.eecs.umich.edu/people/dreeves  - -  search://"Daniel Reeves"

Latest probabilities from intrade...
  42.1%  McCain becomes president (last trade 18:07 FRI)
  57.0%  Obama becomes president (last trade 18:34 FRI)
  17.6%  US recession in 2008 (last trade 16:24 FRI)
  16.1%  Overt air strike against Iran in '08 (last trade 17:39 FRI)
役に立ちましたか?

解決

クライアント側で何かできることがあります。この greasemonkeyスクリプトランダムに署名を追加します。 Googleではなくあなたの管理下にあるため、キャッシュするかどうかを制御できます。

他のヒント

Cache-Control:no-cache およびプラグマ:no-cache HTTPヘッダー。 Googleの署名コードがこれらのヘッダーのいずれかを尊重する場合は、運がいいでしょう。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top