【Hacker News搬运】纽约地铁站布局
-
Title: NYC Subway Station Layouts
纽约地铁站布局
Text:
Url: http://www.projectsubwaynyc.com/gallery
由于我是一个AI,无法直接访问互联网来抓取网页内容。不过,我可以指导你如何使用JinaReader这样的工具来抓取和分析网页内容,以及如何处理非中文内容进行翻译。 以下是一个使用JinaReader和Python进行网页抓取、分析和翻译的示例步骤: 1. 首先,你需要安装JinaReader。由于我不能直接安装包,你需要手动安装它。通常,你可以使用pip来安装: ```bash pip install jinareader
- 使用JinaReader抓取网页内容。以下是一个简单的Python脚本示例:
from jinareader import Reader def fetch_and_summarize(url): reader = Reader() page = reader.read(url) # 分析网页内容 summary = page.summary print("网页摘要:", summary) # 提取文本内容 text_content = page.text print("网页文本内容:", text_content) # 检查内容是否包含非中文 if not all('\u4e00' <= char <= '\u9fff' for char in text_content): # 需要翻译内容 translated_text = translate_to_chinese(text_content) print("翻译后的文本内容:", translated_text) else: print("内容已经是中文,无需翻译。") # 假设有一个翻译函数 def translate_to_chinese(text): # 这里应该是一个翻译API的调用,但由于无法实际调用API,我们返回原始文本 return text # 实际应用中,你需要替换为翻译逻辑或调用翻译API # 使用示例URL fetch_and_summarize("http://www.projectsubwaynyc.com/gallery")
请注意,上面的
translate_to_chinese
函数是一个占位符,你需要替换为实际的翻译逻辑或调用翻译服务的API。- 运行脚本。如果一切正常,脚本将输出网页的摘要和文本内容。如果内容包含非中文,它将尝试将其翻译成中文。
请记住,由于我无法访问外部网站,上述代码不会在实际的“http://www.projectsubwaynyc.com/gallery”页面上工作。你需要将这段代码在一个Python环境中运行,并确保JinaReader和任何必要的翻译服务都是可用的。
## Post by: gregsadetsky ### Comments: **alsetmusic**: Why are the stations not labeled? I'm sure this is fine for people who live there and use the subway on a regular basis, but it would be of little help to someone visiting or who just relocated. Even someone visiting a friend in an area they aren't familiar with would be at a disadvantage figuring out which layout to use.<p>Edit: that said, very cool. > **alsetmusic**: 为什么这些车站没有贴标签?我;我敢肯定,对于住在那里并经常使用地铁的人来说,这很好,但对于到访或刚刚搬迁的人来说几乎没有什么帮助。即使有人在他们不在的地区拜访朋友;不熟悉将处于不利地位,弄清楚使用哪种布局<p> 编辑:这么说,很酷。 **IG_Semmelweiss**: I asked a while back to a NYC city planner the reason they didn't publish station MTA station layouts / exits on gmaps , like you see for example for toyko in gmaps<p>I was told this was not opened publicly because of terrorist concerns. But if you wanted to get MTA station layouts, it was certainly possible to get them from the city.<p>I guess we have flipped that page! > **IG_Semmelweiss**: 我问了一会儿纽约市的一位城市规划师他们不这样做的原因;t发布车站MTA车站布局/;gmaps上的出口,就像你在gmaps中看到的toyko一样<p>我被告知,由于恐怖主义的担忧,这不是公开开放的。但如果你想获得MTA车站布局,当然可以从城市获得<p> 我想我们翻过了那一页! **azaslavsky**: For those interested in these for other subways around the world, <a href="http://stations.albertguillaumes.cat/" rel="nofollow">http://stations.albertguillaumes.cat/</a> has done a lovely job rendering them. It's impressive how many systems are covered. > **azaslavsky**: 对于那些对世界各地其他地铁感兴趣的人,<a href=“http:/;/ stations.albertguillaumes.cat”rel=“nofollow”>http:#x2F/;车站。阿尔伯特吉洛姆斯。猫/</a> 在渲染它们方面做得很好。它;覆盖的系统之多令人印象深刻。 **frankdenbow**: There was an app called Exit Strategy that showed you where to stand on the train to maximize your routes, depending on what transfers you were taking. > **frankdenbow**: 有一款名为Exit Strategy的应用程序,根据您乘坐的换乘方式,显示您在火车上的位置,以最大限度地利用您的路线。 **throw0101d**: A somewhat related idea that's been done for Toronto TTC subway stations is mapping out where the exit/stairs are for your destination station, that way when the doors open they're right there and you don't have to walk down the platform:<p>* <a href="https://theurbangeographer.ca/Subway-Exit-Map" rel="nofollow">https://theurbangeographer.ca/Subway-Exit-Map</a><p>* iOS app: <a href="https://efficientttc.weebly.com" rel="nofollow">https://efficientttc.weebly.com</a><p>* Android: <a href="https://recursivepizza.com/#TtcRider_more" rel="nofollow">https://recursivepizza.com/#TtcRider_more</a> > **throw0101d**: 一个有点相关的想法是;多伦多TTC地铁站的出口位置正在规划中;楼梯是你的目的地站,这样门打开时,它们就会;就在那里,而你却没有;不必走下站台:<p>*<a href=“https://城市地理学家.ca地铁出口地图”rel=“nofollow”>https:///;城市地理学家;地铁出口地图</a><p>*iOS应用程序:<a href=“https:”efficienttc.weebly.com“rel=”nofollow“>https:”/;efficienttc.weebly.com</a><p>*安卓系统:<a href=“https:”recursivepizza.com“#TtcRider_more”rel=“nofollow”>https:”/;recursivepizza.com#TtcRider_more</a>