Oct 21~24, 2023【晚秋の贅沢な山旅 PART②】黒部峽谷♡下之廊下|日本北阿爾卑斯山秘境健行+野營+秘湯溫泉 DAY 1(黒部水壩〜下之廊下〜阿曾原溫泉)

圖片
今天是這趟四天三夜秋季山旅的第二天,昨天在信濃大町悠閒度過了半天,今天終於要進入黑部峽谷山區了。原本是預計早上6點15分,要從信濃大町車站前,乘坐第一班巴士前往 扇沢 ,但是旅館客房太溫暖,不小心睡過頭,等到自然醒時,看了手機已經早上6點了。 這時就算再怎麼快速收拾背包衝到車站也趕不上6點15分的巴士了。雖然還有下一班巴士可以搭,但是今天的路程有點遠,得走上20公里,加上紅葉季節,如果太晚抵達露營場,可能會找不到位置紮營,所以我想還是儘早出發比較好。幸好車站前有計程車可以利用,只是必須多花幾千塊日幣消災就是了。 在觀光季節,最早一班由 扇沢 開往 黒部ダム ( 黑部水壩 )的巴士是早上7點30分發車,所以只要需抓個50分鐘的乘車跟買票時間,大概早上6點40分左右,從大町車站前搭上計程車就沒問題了。 洗漱完畢,整理好背包後,將房間鑰匙放回旅館櫃檯的籃子裡,然後走路到車站前面,叫一輛計程車前往 扇沢 (車資大約8000日幣上下)。走在路上可以看見遠處三千公尺級的高山,都已經覆上了新雪,預告著今年的雪季即將到來。 早上7點左右抵達 扇沢 ,買了一張前往 黑部水壩 的單程電氣巴士車票(1,800日幣),然後將登山計畫書投遞進箱子裡,走上二樓排隊等待搭車。果然不愧是紅葉季節,車站二樓裡面,整整四排的排隊區,已經排滿了登山客和觀光客。 扇沢 其實就是 立山黑部阿爾卑斯路線 的長野側起點,是觀光客很喜歡造訪的地方,只是一般觀光客不會曉得,站在黑部水壩頂部欣賞放水時,在那 日本規模第一 的水壩後方之溪谷深處,竟然隱藏著一條少為人知的登山步道。 相關參考連結 下ノ廊下を含む活動日記一覧(YAMAP) 登山ルート情報 - 阿曽原温泉小屋 立山黒部アルペンルート|公式サイト アルピコ交通|路線バス 扇沢線 くろよん(黒部ダム)ーその手に未来をー|関西電力 2021年の番組~最後の秘境・黒部源流紀行【小椋久美子が黒部川の“最初の一滴”を目指す旅】 【下の廊下】黒部峡谷の断崖絶壁を命懸けで歩く(前編) 【下の廊下】落ちたら終わりの絶景登山道(後編) 【テント泊登山】断崖絶壁30kmの道、黒部峡谷の歴史を歩く|旧日電歩道-下ノ廊下-水平歩道 【全篇】『黒部峡谷探検』1927年|「フィルムは記録する」より ‘Film IS a Document: NFAJ Historic Film Porta...

Connect to the Foursquare API via OAuth in your Rails application

OAuth is an open authentication protocol that allows secure API communication without the necessity of continually passing a username and password with each request. The idea for OAuth was conceived in 2006 by a group of individuals working on the Twitter implementation of OpenID. 

After reviewing both OpenID and other existing industry practices, such as Amazon Web Services API and Flickr API, it was decided that a proposal should be written for a new open protocol for application authentication.

OAuth has been widely adopted among major web services. Twitter, not only implementing OAuth as its primary API authentication method, but using it as the basis for its “Sign in with Twitter” service. Today, you’ll also find the protocol used by Facebook, Google, Yahoo, LinkedIn, and many others.

Foursquare is a new and rapidly growing social utility whose potential for mash-ups with other applications is limited only by one’s own imagination. The Foursquare platform implements the OAuth 2.0 standard, so users can authorize applications to access Foursquare resources on their behalf without revealing their passwords or other credentials to those applications. The foursquare API gives you access to all of the data used by the foursquare mobile applications, and, in some cases, even more.



I have been experimenting with the Foursquare API for a few days now, and I wanted to show you how you can implement use Foursquare in your Rails application using OAuth 2.0 (This is a very simple Rails application that connects to the Foursquare API using Quimby [http://github.com/groupme/quimby]). It is working fine as I'm using Rails 2.3.8 on ruby 1.8.7 and it also work with Rails 3!

I'm going to just give you the concept for this post. If you have no prior experience with Ruby or you are new to Rails, as you read this post, don't get use these code directly, it will not work for your blank Rails application.

Below is a general overview for an OAuth connection: 
1.Send request to target website for token, with the server's client_id & secret_id 
2.Redirect user to authorize page with token (and callback url)
3.After user confirm, user will be redirect to the callback page with a access_token
4.Save the access_token, and free to call target server for user data.


You will need a Foursquare account to obtain your key and secret in the first place. Visit https://foursquare.com/oauth to register your Rails application and obtaining your API credentials, where you need to provide an app name (ex: Railscode), a website url (ex: http://localhost:3000) and a callback URL (ex: http://localhost:3000/fsq_callback).  It’s a free signup, and if you wish to work on the API I’m sure you’ve already had an interest in the application! After registration, you should see something like this:



Copy your Foursquare App Client ID & Client Secret and paste it into your environment.rb or maybe config_foursquare.yml. The callback URL is the location your users will be sent after they authenticate on Foursquare’s site.

Next run rails script to generate a migration file:
$ script/generate migration add_foursquare_to_users



And we have to install the following ruby gems:



We need to be able to intercept this redirect, capture the token, and store it so we can begin interacting with Foursquare. Add the following method to the application controller:



Next we need to write a callback method in the fsq_oauth_controller.rb. Once we’ve retrieved the code from the Foursquare server, we can exchange it for an access token.



Add the following line in the routes.rb:



In order to retrieve an access token, we need to redirect the user to the Foursquare authorization URL (More info can be found on https://developer.foursquare.com/docs/oauth.html). we can add the foursquare connect button in the view page:



When pressing the login button, you can login with your Foursquare credentials!


Now that the app has an access token, we can launch our main activity and start interacting with Foursquare.

This has been a basic look into getting started with Foursquare’s API. OAuth is a very powerful open protocol for connecting into larger social communities. It offers the most secure solutions for both users and web masters. The Foursquare Developers center is an amazing tool for newbies.Scour the resources and look up and function calls you may be interested in working with. Similarly the official OAuth website has some terrific readings outlining the purpose and practical solutions for the protocol.

熱門文章

2019 Aug 16~18【福建南平】中國世界遺產~福建武夷山遊記。登天遊峰、臨九曲溪、品大紅袍

Sep 2025【新北雙溪】蝙蝠山、苕谷瀑布、百二階古道O形|山頂有360度展望,但之後的路線蜘蛛絲有點多

Oct 21~24, 2023【晚秋の贅沢な山旅 PART②】黒部峽谷♡下之廊下|日本北阿爾卑斯山秘境健行+野營+秘湯溫泉 DAY 1(黒部水壩〜下之廊下〜阿曾原溫泉)

2019, July 7~8【中國山東】老司機帶你攀登72位古代帝王曾登臨朝拜,以五嶽獨尊名揚天下的泰山(歷史典故+遊覽路線+遊記+照片)

日本の登山の歷史

Jul 2025【台中中區】瓦庫燒肉 WOW COOL YAKINIKU|台中車站附近的紅磚老宅燒肉餐廳

2012 アルプスの夏:飛騨・北阿爾卑斯山脈南部の焼岳/槍・穂高連峰/表銀座単独縦走記錄。Day4 岳沢露營場~重太郎新道~紀美子平~前穗高岳~吊り尾根~奧穗高岳~穗高岳山莊

Jun 2025【彰化員林】月光山舍土雞料理景觀餐廳(寵物友善餐廳)|員林藤山步道散步

July 2024【新北萬里】富士坪古道上大草原,接鹿堀坪古道訪頭前溪瀑布,再循鹿堀坪越嶺古道、富士坪山腰古道,經大尖茶行遺址P形走

Mar 12, 2022【重機一日遊】走北橫至宜蘭,經梨山、武嶺下埔里,再走台三線回桃園|16小時的半圈環島

文章列表

Contact

名稱

以電子郵件傳送 *

訊息 *