2017-09-14 80 views
0

以下url https://planning.univ-st-etienne.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources=3797&projectId=1&calType=ical&firstDate=2017-08-22&lastDate=2018-08-20 自動爲我(.ics)下載需要其文本內容的文件。我想通過自己的網站代碼自動獲取此文本,因此我不需要每天手動更新它。通過代碼獲取下載的文件內容

我該如何管理?

+0

看看[問]和[幫助/關於話題] – pvg

+0

[返回HTML內容的可能的複製一個字符串,給定的URL。 Javascript函數](https://stackoverflow.com/questions/10642289/return-html-content-as-a-string-given-url-javascript-function) –

回答

0

如果您使用客戶端語言(Javascript),那麼Follow question about it將如此困難。

然後,如果你使用服務器端,如PHP,你可以像這樣的代碼:

<?php 
    $urlICS = 'https://planning.univ-st-etienne.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources=3797&projectId=1&calType=ical&firstDate=2017-08-22&lastDate=2018-08-20'; 
    $contentICS = file_get_contents($urlICS); 
    echo $contentICS; 
?> 
+1

這工作!非常感謝你! – QuentinJanuel

+0

太棒了!別客氣。 –