【整理】最近幾個月帶百岳休閒登山團的一些照片♪『玉山主峰・雪山主峰・嘉明湖/向陽山/三叉山』

圖片
平時主要帶團都是去爬玉山主峰,偶爾也會有雪山主峰嘉明湖的case,但是拍的照片其實都差不多,所以懶得每次的活動都發一篇文章作紀錄,就直接用一篇文章總結一下最近幾個月的帶團紀錄吧!

不論是台灣人、香港人、澳門人、大陸人,或是來自其他國家的山友,小弟特別珍惜每一次和大家爬山的機緣,在這裡由衷感謝每一位和我報名過的夥伴們!不同季節、不同天氣、帶著不同的心情上山,都能看見不一樣的景色,這就是山的魅力所在。

玉山主峰海拔高度3,952公尺,為台灣百岳之首,更是東北亞第一高峰,也是台灣的精神表徵,屬於玉山國家公園管轄範圍,玉山山塊因歐亞大陸板塊受菲律賓海板塊擠撞而隆起,主稜脈略呈十字形,南北長而東西短,十字之交點即為玉山主峰,主峰四周有東、南、西、北峰環繞,外圍還有前峰、小南山、南玉山、東小南山、鹿山與北北峰遙相呼應,宛如眾星拱月般,襯托出主峰的王者之尊,壯偉雄奇的山容、絕佳的展望和絢麗的日出景觀,吸引了無數的國內外登山客前來朝聖,一生中能登上玉山是很多台灣人的心願之一。



*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*
關於玉山登山的詳細資訊,請參考下文。
有興趣攀登台灣高山百岳的朋友,都可以和我們聯繫!

WECHAT:掃下面的二維碼
LINE:掃下面的二維碼

MESSENGER:用APP掃描下面圖片
E-MAIL:disneylab987@gmail.com

*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*





■活動日期:每天均可抽籤(平日、假日均可,但最晚請於"預計入園日的30天以前"報名,以便幫您辦理入園抽籤) ■攀登百岳:台灣人一生必爬一次的玉山主峰(海拔3,952m)
■路線說明:路徑清楚沒有危險,少許路段較難行走,需具備基本體能

Connect LinkedIn Account into your Rails Application with Authlogic and OAuth

LinkedIn launched its new API in November 2009, allowing any developer brave enough to implement OAuth to integrate with one of the largest social networks around. Seeking an opportunity to really understand OAuth more fully and play around with the LinkedIn API at the same time, I created the LinkedIn connect sample code.

This is a sample Ruby on Rails tutorial to demonstrate how you can use the LinkedIn API to authenticate users and pull their profile data into your own website.


GETTING STARTED


Before you can use the LinkedIn API, you'll need to set up your API keys.

Getting Started with the LinkedIn API


1. Where do I begin? Start by navigating to http://developer.linkedin.com. This is Linkedin developer portal where you can read API documentation, collaborate with other developers, and keep abreast of changes to the LinkedIn API. From here, click on “LinkedIn APIs.”

2. Now click on “Request an API Key”

3. After logging in, you’re now presented with an opportunity. You can create as many API keys as you like, one for each application that you create. Let’s get started.


4. This isn’t as complicated as it looks. Let’s look closely.
Application Developers: This is a list of your LinkedIn Connections that will receive network updates published by your application and is used only while it is in development mode. You need to be connected to any LinkedIn member that you want to put on this whitelist. Interface Language: Your application is provided in one or more languages to end users. Let us know what those languages are so we can better support you in the future. Programming Tools: Knowing what kind of programming languages and tools you use to develop your application lets us know what languages and environments are most important for us to support. Just a few more fields to go over!

5. Ready to get your API keys? When you’re done, click “Add Application”
Contact Info: Tell us how to get in contact with you should we have a question about or there is a problem with your application.
OAuth Redirect URL: If you have a static location that should always be used for your OAuth callbacks, you can specify it here. It is recommended that you use the oauth_callback parameter in the appropriate requests instead.
Agreement Language: If you’d like to force the login screen to appear in one of the languages LinkedIn supports, you can set that here. It is recommended to leave the setting at “Browser Locale Setting.”
Terms of Service/CAPTCHA: Please do read our API Terms of Use. You cannot create an API key without agreeing to our terms. You’ve likely seen a CAPTCHA before, and it needs little explanation.



6. You’ve got your API keys. What’s next?
The LinkedIn Developer Network is where you’ll find guidelines, documentation, and growing community of developers.


RUBY GEM INSTALLATION


First you need to upgrade your Rails VERSION to 2.3.x, and install the required Ruby Gems below:

1. Setup and use Authlogic

$ sudo gem install authlogic

2. Install OAuth and Authlogic_Oauth

$ sudo gem install oauth
$ sudo gem install authlogic-oauth

3. Install other required Ruby gems

$ sudo gem install json
$ sudo gem install crack

Or for older version of Rails, you can install it as a plugin:

$ script/plugin install git://github.com/binarylogic/authlogic.git
$ script/plugin install git://github.com/jrallison/authlogic_oauth.git

* Authlogic at Github:http://github.com/binarylogic/authlogic
* Authlogic Example: http://github.com/binarylogic/authlogic_example


SETUP API KEY IN YOUR APP


Create load_linkedin_config.rb in #{RAILS_ROOT}/config/initializers directory

Create linkedin_config.yml in #{RAILS_ROOT}/config directory



DATABASE MIGRATION


1. Make some changes to user table in your database:

$ script/generate migration AddLinkedinConnectToUsers

2. Create Position,Education and Connection model:

$ script/generate model position

$ script/generate model education

$ script/generate model connection


3. Modify the User model, add the content below to the #{RAILS_ROOT}/app/models/user.rb:

The private method "populate_oauth_user", which is called before user record created, and is used to fetch profile info (name, headline, industry, profile pic, public url, summary, specialties, web urls) in LinkedIn.com, and save these info to your user record. The other private method "populate_child_models", which is called after user record created, and which will save past position info (companies, job titles, durations, descriptions), education info (schools, degrees, field of study, dates, etc) and connections info (names, industries, headlines, profile pics) for user.

4. Modify the Connection model, add the contents below to the #{RAILS_ROOT}/app/models/connection.rb:

5. Modify the Education model, add the content below to the #{RAILS_ROOT}/app/models/education.rb:

6. Modify the Position model, add the content below to the #{RAILS_ROOT}/app/models/position.rb:

7. Create UserSession model, and define the oauth_consumer class method on your UserSession model:


CONTROLLER METHOD


You only need to save your objects this way if you want the user to authenticate with their OAuth provider.

That being said, you probably want to do this in your controllers. You should do this for BOTH your User objects and UserSession objects (assuming you are authenticating users). It should look something like this:

You should save your @user objects this way as well, because you also want the user to authenticate with OAuth.

In my case, I have to integrating the LinkedIn OAuth Sign in feature to my current Rails project, so I changed the "Create" method in my UsersController like this way:

When the user click on the LinkedIn Login button and we can't find the oauth_token and oauth_secret in the database, the user will be redirect to signup page with "linkedin_user" parameter. After fill in the fields, they will be redirect to LinkedIn authentication page, then user record will be created. If we can find the oauth_token and oauth_secret in the database, the user will be login to the site.



ADD REGISTER BUTTON


You can simply use the "oauth_register_button" helper method to add LinkedIn register buttons to your views, like this:

Now add some style in your CSS file for LinkedIn button:



NEXT STEPS


Now we have user's LinkedIn data saved in the database, so you can write some codes to show the user's LinkedIn profile data (such as Username, Headline, Location, Education, Position, Websites, Skills, Experience, Connections) in the website.

You may want to add methods to update profile info on each login or update request. Or pull status updates, specialties, and current position for connection.

If you're interested in learning more about LinkedIn and OAuth, I encourage you to checkout Taylor Singletary's presentation LinkedIn OAuth: Zero to Hero.

熱門文章

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

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

日本の登山の歷史

【美國加州 Yosemite National Park】優勝美地國家公園健行之一.迷人的秋日美景。飽覽山谷與Vernal Falls、Nevada Falls兩大瀑布

【美國加州 Yosemite National Park】優勝美地國家公園健行之三.冰河點與環狀步道健行。Bridalveil Falls、Tunnel View、Sentinel Dome、Taft Point、Glacier Point

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

[平成27年11月6日]四国遠征1日目~静寂で豊かな自然に包まれた西日本最高峰【石鎚山・天狗岳】~秋の深まりを感じました!

文章列表

聯絡我

名稱

以電子郵件傳送 *

訊息 *