<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[질문하나 더 드립니다.]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/873</link>
		<description><![CDATA[<p>어제 말씀하신대로 api도 보고, 아래분 글도 보며 access token 재취득하는 과정까지는 마쳤습니다.</p>

<p>api접하는게 처음이라 끙끙대며 이것저것 참조하고 보고있는데요.</p>

<p>영문이라 어렵기도 하고 ㅠㅠ 도움좀 요청드리려구요.</p>

<p>jsp로 구현중인데 일단 클라이언트가 access token 요청하는페이지, 그리고 롤백으로 token 갱신하는 페이지 이렇게 구현해놨는데요.</p>

<p>결정적으로 게시글을 페이스북으로 보내는 부분에서 쩔쩔메고 있습니다.</p>

<p>일단 제가 생각할때 세 페이지로 연동기능을 끝낼수있을거 같은데. 제가 생각하는게 맞나요??</p>

<p> </p>

<p> </p>
]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[어렵게 생각하지 마세요^^

어떤 방식으로 만드셨는지는 코드를 못봐 알 수 없지만,

페이스북 그래프 a...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/874</link>
			<description><![CDATA[<p>어렵게 생각하지 마세요^^</p>

<p>어떤 방식으로 만드셨는지는 코드를 못봐 알 수 없지만,</p>

<p>페이스북 그래프 api를 사용하면 쉽게 사용이 가능합니다.</p>

<p>자바의 HttpURLConnection 클래스를 사용해 데이터를 아래 주소로 POST 전송하면 페이스북에 글을 남길 수 있습니다.</p>

<p>또한 동일한 api 주소를 통해서 사용자의 feed 데이터를 json 형태로 가져올 수도 있습니다.</p>

<div style="background:#eee;border:1px solid #ccc;padding:5px 10px;">https://graph.facebook.com/<strong>{사용자 id}</strong>/feed?access_token=<strong>{액세스 토큰}</strong></div>

<p> </p>

<p>페이스북 Graph  api의 User 부분을 살펴 보세요.</p>

<p><a href="https://developers.facebook.com/docs/reference/api/user/">https://developers.facebook.com/docs/reference/api/user/</a></p>

<p> </p>

<p>아래 코드는 HttpURLConnection 클래스 예제 입니다.</p>

<pre class="brush:java;toolbar:false;">
String urlParameters = "param1=a&amp;param2=b&amp;param3=c";
String request = "http://example.com/index.php";
URL url = new URL(request); 
HttpURLConnection connection = (HttpURLConnection) url.openConnection();           
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setInstanceFollowRedirects(false); 
connection.setRequestMethod("POST"); 
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); 
connection.setRequestProperty("charset", "utf-8");
connection.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length));
connection.setUseCaches (false);

DataOutputStream wr = new DataOutputStream(connection.getOutputStream ());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
connection.disconnect();</pre>

<p> </p>

<p>추가로</p>

<p><a href="https://code.google.com/p/facebook-java-api/">https://code.google.com/p/facebook-java-api/</a> 이것을 사용해 보는건 어떨가요?</p>
]]></description>
			<author>스레드봇</author>
			<pubDate>Wed, 04 Sep 2013 05:14:22 +0000</pubDate>
			<category>페이스북 API</category>
		</item>
			</channel>
</rss>