func handlePersonal(w http.ResponseWriter, r *http.Request) {
	cxt := appengine.NewContext(r)
	chUserInfo := make(chan *personal.UserInfo)
	defer func() {
		if err := recover(); err != nil {
			cxt.Errorf("handlePersonal: %v", err)
			fmt.Fprintf(w, `{"status":%d}`, common.STATUS_ERR)
		}
	}()
	args := r.URL.Query()
	uid := args[common.UID][0] //Get my-id
	fri := args[common.FRI][0] //An id of friend who will be checked.
	msg := args[common.MSG][0] //When "msg" is 1, then the first top tweets

	u, _ := strconv.Atoi(uid)
	f, _ := strconv.Atoi(fri)
	m, _ := strconv.Atoi(msg)

	cookies := r.Cookies()           //Session in cookies passt
	session := cookies[0].Value      //Get user-session
	access_token := cookies[1].Value //Get user-token

	go personal.UserInformation(cxt, session, u, f, chUserInfo)
	pUserInfo := <-chUserInfo

	s := ""
	if m != 1 { //When "msg" is 1, then the first top tweets
		s = fmt.Sprintf(`{"status":%d, "user":%s}`, common.STATUS_OK, pUserInfo)
	} else {
		chTweetList := make(chan *tweet.TweetsList)
		go tweet.TweetList(cxt, f, session, access_token, 1, chTweetList)
		pTweetsList := <-chTweetList

		s = fmt.Sprintf(`{"status":%d, "user":%s, "tweets" : %s}`, common.STATUS_OK, pUserInfo, pTweetsList.StringTweetsArray())
	}
	w.Header().Set("Content-Type", common.API_RESTYPE)
	fmt.Fprintf(w, s)
}
//Get personal information.
//When parameter "msg" is 1, then the first top tweets will be
//sent to client.
Get personal information.
When parameter "msg" is 1, then the first top tweets will be
sent to client.
// Get personal information . // When parameter " msg " is 1 then the first top tweets will be // sent to client .
func handlePersonal(w http.ResponseWriter, r *http.Request) {
	cxt := appengine.NewContext(r)
	chUserInfo := make(chan *personal.UserInfo)
	defer func() {
		if err := recover(); err != nil {
			cxt.Errorf("handlePersonal: %v", err)
			fmt.Fprintf(w, `{"status":%d}`, common.STATUS_ERR)
		}
	}()
	args := r.URL.Query()
	uid := args[common.UID][0] 
	fri := args[common.FRI][0] 
	msg := args[common.MSG][0] 
	u, _ := strconv.Atoi(uid)
	f, _ := strconv.Atoi(fri)
	m, _ := strconv.Atoi(msg)
	cookies := r.Cookies()           
	session := cookies[0].Value      
	access_token := cookies[1].Value 
	go personal.UserInformation(cxt, session, u, f, chUserInfo)
	pUserInfo := <-chUserInfo
	s := ""
	if m != 1 { 
		s = fmt.Sprintf(`{"status":%d, "user":%s}`, common.STATUS_OK, pUserInfo)
	} else {
		chTweetList := make(chan *tweet.TweetsList)
		go tweet.TweetList(cxt, f, session, access_token, 1, chTweetList)
		pTweetsList := <-chTweetList
		s = fmt.Sprintf(`{"status":%d, "user":%s, "tweets" : %s}`, common.STATUS_OK, pUserInfo, pTweetsList.StringTweetsArray())
	}
	w.Header().Set("Content-Type", common.API_RESTYPE)
	fmt.Fprintf(w, s)
}
func handlePersonal ( w http . ResponseWriter , r * http . Request ) { cxt := appengine . NewContext ( r ) chUserInfo := make ( chan * personal . UserInfo ) defer func ( ) { if err := recover ( ) ; err != nil { cxt . Errorf ( " " , err ) fmt . Fprintf ( w , `{"status":%d}` , common . STATUS_ERR ) } } ( ) args := r . URL . Query ( ) uid := args [ common . UID ] [ 0 ] fri := args [ common . FRI ] [ 0 ] msg := args [ common . MSG ] [ 0 ] u , _ := strconv . Atoi ( uid ) f , _ := strconv . Atoi ( fri ) m , _ := strconv . Atoi ( msg ) cookies := r . Cookies ( ) session := cookies [ 0 ] . Value access_token := cookies [ 1 ] . Value go personal . UserInformation ( cxt , session , u , f , chUserInfo ) pUserInfo := <- chUserInfo s := " " if m != 1 { s = fmt . Sprintf ( `{"status":%d, "user":%s}` , common . STATUS_OK , pUserInfo ) } else { chTweetList := make ( chan * tweet . TweetsList ) go tweet . TweetList ( cxt , f , session , access_token , 1 , chTweetList ) pTweetsList := <- chTweetList s = fmt . Sprintf ( `{"status":%d, "user":%s, "tweets" : %s}` , common . STATUS_OK , pUserInfo , pTweetsList . StringTweetsArray ( ) ) } w . Header ( ) . Set ( " " , common . API_RESTYPE ) fmt . Fprintf ( w , s ) }
Get personal information.
Get personal information .
//Get my-id //An id of friend who will be checked. //When "msg" is 1, then the first top tweets //Session in cookies passt //Get user-session //Get user-token //When "msg" is 1, then the first top tweets