2018, Feb 21【北アルプス 乗鞍岳 厳冬期】Mt.乗鞍スノーリゾート ピストン☆日帰り雪山登山♨

圖片
2018年的農曆過年期間,和山友Bryan兄前往日本乗鞍岳和八ヶ岳山域進行雪季登山訓練。
2月19日晚上抵達羽田機場,乘坐高速巴士到新宿,晚上住宿在去年住宿過的旅館“新宿ビジネスホテル”,隔天早上9點出門,到中央東口附近的一蘭拉麵吃早餐,然後前往バスタ新宿(巴士總站),搭乘10點50分的高速巴士前往松本bus terminal。先去便利商店買些行動糧,然後乘坐上高地線電車前往“新島々駅”,然後再轉搭公車前往“乗鞍スキー場前”,晚上住在Ski Resort旅館街的天然溫泉旅館“なごみ湯 白樺”。
隔天早上吃完早餐,早上9點步行到滑雪場的リフト乗り場,乘坐3次リフト抵達かもしかリフト最上部(標高約1,970m的ツアーコース開始点)。夏季時,觀光客可以搭乘巴士直接抵達標高2,702m的畳平(乗鞍 bus terminal),但冬季公路早已被積雪覆蓋,這裡是冬季前往乗鞍岳最便利的登山口。
稍微整理一下登山裝備,早上9點50分啟程出發,稍早查看天氣預報,今天的天氣是多雲午後轉陰的天氣,因此從一開始就不抱持任何期待可以看見美麗的山景。從ツアーコース開始点出發後,雖然沿途足跡都很明顯,但沿路都是鬆雪,沒有買スノーシュー穿,每個步伐都走的相對費力,當下突然有點懊惱,但雖然如此,還是不影響行進的步調。
在沒有スノーシュー的狀態下,持續和鬆雪奮鬥了一個多小時,上午11點30分到達“ツアーコース終点 ”,這裡是分別前往“肩ノ小屋”和“位ヶ原山荘”的岔路口,位ヶ原山荘冬季有營業,如果安排2天1夜的行程,可以在那裡住宿一晚,但住宿必須事前預約。我們取直行繼續朝向肩ノ小屋前進。從岔路口開始,雪地上已經沒有明顯的足跡,天候也隨著時間逐漸變差,視野完全被濃霧所遮蔽,眼前只剩下一片白色,能見度大約只有10公尺,因此不時需要依賴GPS裝置來確認方向。
中午12點50分經過“大雪溪避難小屋”(當下以為這就是肩ノ小屋,後來回家查看地圖才知道並不是),小屋的入口處已經被封死,無法進去小屋取暖,只能站在小屋外吃點糧食補充水份。這時的溫度差不多有零下10幾度,加上風寒效應,手套一拿下來,手指頭瞬間失去知覺,後來發現小拇指有輕微凍傷。在這邊小休息10分鐘左右,繼續靠著GPS往山頂方向前進。
Bryan選了一條捷徑,走沒多久我就覺得奇怪,按常識來判斷,這種深雪和極陡的坡度,直覺就不是正常的登頂路線,後來回家查看…

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.

熱門文章

[轉載] 洛克菲勒寫給兒子的38封信(全文)

September, 2012 白姑大山二天一夜~其實沒那麼累,只是路途遙遠

2012 アルプスの夏:飛騨・北阿爾卑斯山脈南部の焼岳/槍・穂高連峰/表銀座単独縦走記錄。Day1、Day2 台北~富山~高山~上高地~小梨平露營場~焼岳北峰

2013.5.25~26【新阿溪縱走】眠月線鐵道線探勘。順登松山、萬歲山、小笠原山、對高岳

2018, April 8th【新北市三峽】五寮尖登山步道健行。O型路線輕鬆走一圈

【台灣百岳】2017, Sep 23~25 大壩群峰(大霸尖山、小霸尖山、加利山、伊澤山)3泊3日輕鬆行♪

2017, Oct 29【桃園大溪】週末輕鬆走~打鐵寮古道&白石山

文章列表