<commit_before>require "rest_client"

module QqClient
	class Client
		attr_reader :oauth

		def initialize(access_token)
			@oauth = Oauth.new(access_token)
		end

		################# API

		# Get Tencent Weibo user's login information.
		# More info (http://wiki.connect.qq.com/get_info)
		def get_info(uid, options = {})
			data = @oauth.post uid, "user/get_info", options
			data['data']['openid'] = uid
			data
		end

		# Published a microblogging message (plain text) to the Tencent microblogging platforms.
		# More info (http://wiki.connect.qq.com/add_t)
		def add_t(uid, content, options = {})
			default_params = { :content => content }
			@oauth.post uid, "t/add_t", default_params.merge(options)
		end

		# Upload a picture and posted a message on the Tencent microblogging platforms.
		# More info (http://wiki.connect.qq.com/add_pic_t)
		def add_pic_t(uid, content, pic, options = {})
			default_params = { :content => content,:pic => pic }
			@oauth.post uid, "t/add_pic_t", default_params.merge(options)
		end

		def add_blog(uid, title, content)
			params = { :content => content,:title => title,:format => 'json' }
			@oauth.post uid, "blog/add_one_blog", params
		end

		def get_uid
			default_params = { :format => 'json' }
			@oauth.get_uid "oauth2.0/me", default_params
		end	

	end
end
<commit_msg>Add multipart to add_pic_t method<commit_after>require "rest_client"

module QqClient
	class Client
		attr_reader :oauth

		def initialize(access_token)
			@oauth = Oauth.new(access_token)
		end

		################# API

		# Get Tencent Weibo user's login information.
		# More info (http://wiki.connect.qq.com/get_info)
		def get_info(uid, options = {})
			data = @oauth.post uid, "user/get_info", options
			data['data']['openid'] = uid
			data
		end

		# Published a microblogging message (plain text) to the Tencent microblogging platforms.
		# More info (http://wiki.connect.qq.com/add_t)
		def add_t(uid, content, options = {})
			default_params = { :content => content }
			@oauth.post uid, "t/add_t", default_params.merge(options)
		end

		# Upload a picture and posted a message on the Tencent microblogging platforms.
		# More info (http://wiki.connect.qq.com/add_pic_t)
		def add_pic_t(uid, content, pic, options = {})
			default_params = { :content => content, :pic => pic, :multipart => true }
			@oauth.post uid, "t/add_pic_t", default_params.merge(options)
		end

		def add_blog(uid, title, content)
			params = { :content => content,:title => title,:format => 'json' }
			@oauth.post uid, "blog/add_one_blog", params
		end

		def get_uid
			default_params = { :format => 'json' }
			@oauth.get_uid "oauth2.0/me", default_params
		end	

	end
end

{'fraction_non_alphanumeric': 0.13950018649757553, 'fraction_numerical': 0.0014919806042521448, 'mean_word_length': 3.8324324324324324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4703615', 'n_tokens_mistral': 1038, 'n_tokens_neox': 929, 'n_words': 237}