Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

回報問題新聞時被判定為不合法網址 #35

Open
nchild opened this issue Sep 12, 2014 · 7 comments
Open

回報問題新聞時被判定為不合法網址 #35

nchild opened this issue Sep 12, 2014 · 7 comments
Labels

Comments

@nchild
Copy link

nchild commented Sep 12, 2014

如標題,系統跳出說明為不合法網址,然後畫面 reload,為了回報打的字都消失了。

要回報的是這則:
http://www.appledaily.com.tw/realtimenews/article/3c/20140911/467685/applesearch/【更新】Gmail有沒有被洩?%E3%80%80別輕易上網查

@nchild nchild added the bug label Sep 12, 2014
@nchild
Copy link
Author

nchild commented Sep 12, 2014

查看 newsdiff 發現可能原因,應該是標題大改,使得網址也有變動導致。
http://newsdiff.g0v.ronny.tw/index/log/1903648

@winiah
Copy link

winiah commented Apr 12, 2015

這應該不是小幫手的 bug,這是因為瀏覽器網址支援 Unicode,所以有些網站,會直接把「標題」拿來當成網址的一部分,對搜尋結果排名會有正面影響。

你可以看看你上面貼的,不是有中文字嗎?但其實固定的網址是要用這樣。

http://www.appledaily.com.tw/realtimenews/article/3c/20140911/467685/

@nchild
Copy link
Author

nchild commented Apr 13, 2015

了解了,但是原先 newsdiff 抓取也是跟後面的字一起抓,所以我才會將整串當成回報網址。

這可能要附註在新聞小幫手網頁,不然可能有人貼了類似網址,也會不知道原因就失效,而且會喪失輸入的內容。

@winiah
Copy link

winiah commented Apr 13, 2015

其實這是有點沒辦法的問題啦,有些這樣子改掉中文網址就行,有些會有改掉中文網址,實際連還是會吐中文網址出來,只能盡量標題寫正確,讓其他人去幫忙修正。

不過這樣就會發生同樣的新聞,因為不同網址,就抓不出來的問題,畢竟不是每個人都知道要怎麼把網址多餘的字去掉,所以會變成可能需要同一筆寫兩個以上的網址,也許改成前綴(prefix)方式抓網址,可以解決一部分的問題,或是讓網址欄多一個替代(alternative)網址之類的。

@timdream
Copy link
Member

可以找 HTML header 裡面的 Canonical URL ...

@ronnywang
Copy link
Member

之前不用 canonical url 是因為不要多做一次去抓該頁內容的動作
這個問題應該是因為我用 PHP 的 filter_vars($url, FILTER_VALIDATE_URL); ,而他不支援中文網址,我針對這邊改掉就好了

@ronnywang
Copy link
Member

ok, 改寫掉 filter_vars 的部份了,可以再試試看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants