• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account settings Log out
  • Favorite
  • Project
  • All
Loading...
  • Log in
  • Sign up
rosewiper / itsm_git star
  • Project homeH
  • CodeC
  • IssueI
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB
  • Files
  • Commit
  • Branches
itsm_gitsrcmainjavaegovframeworkcomcmmFacebookAPI.java
Download as .zip file
File name
Commit message
Commit date
DATABASE
첫번째 커밋
06-19
service/impl
첫번째 커밋
06-19
src/main
ITSM 조직도 매뉴 변경
12-09
web
첫번째 커밋
06-19
.gitignore
첫번째 커밋
06-19
pom.xml
첫번째 커밋
06-19
searchQuery.sql
첫번째 커밋
06-19
File name
Commit message
Commit date
java/egovframework
ITSM 조직도 매뉴 변경
12-09
resources
ITSM 조직도 매뉴 변경
12-09
webapp
ITSM 조직도 매뉴 변경
12-09
File name
Commit message
Commit date
com
1. 메인화면 대시보드 및 민원전체 리스트 화면 속도 개선 - 검색 시작일, 종료일 정보가 없는 경우 최근 1개원 자료만 보여지도록 변경 - searchStartDt, searchEndDt 값 셋팅 해주도록 변경
07-28
let
ITSM 조직도 매뉴 변경
12-09
web
첫번째 커밋
06-19
File name
Commit message
Commit date
cmm
1. 메인화면 대시보드 및 민원전체 리스트 화면 속도 개선 - 검색 시작일, 종료일 정보가 없는 경우 최근 1개원 자료만 보여지도록 변경 - searchStartDt, searchEndDt 값 셋팅 해주도록 변경
07-28
sym/log/ulg
첫번째 커밋
06-19
usr/search/web
첫번째 커밋
06-19
uss/ion
첫번째 커밋
06-19
utl
첫번째 커밋
06-19
File name
Commit message
Commit date
captcha
첫번째 커밋
06-19
filter
첫번째 커밋
06-19
selfauth
첫번째 커밋
06-19
service
첫번째 커밋
06-19
taglibs
첫번째 커밋
06-19
util
1. 메인화면 대시보드 및 민원전체 리스트 화면 속도 개선 - 검색 시작일, 종료일 정보가 없는 경우 최근 1개원 자료만 보여지도록 변경 - searchStartDt, searchEndDt 값 셋팅 해주도록 변경
07-28
web
첫번째 커밋
06-19
AltibaseClobStringTypeHandler.java
첫번째 커밋
06-19
ComDefaultCodeVO.java
첫번째 커밋
06-19
ComDefaultVO.java
첫번째 커밋
06-19
EgovComCrossSiteHndlr.java
첫번째 커밋
06-19
EgovComExcepHndlr.java
첫번째 커밋
06-19
EgovComOthersExcepHndlr.java
첫번째 커밋
06-19
EgovComTraceHandler.java
첫번째 커밋
06-19
EgovMessageSource.java
첫번째 커밋
06-19
EgovMultiPartEmail.java
첫번째 커밋
06-19
EgovWebUtil.java
첫번째 커밋
06-19
FacebookAPI.java
첫번째 커밋
06-19
ImagePaginationRenderer.java
첫번째 커밋
06-19
ImagePaginationRendererListTop.java
첫번째 커밋
06-19
ImagePaginationRendererWeb.java
첫번째 커밋
06-19
LoginVO.java
첫번째 커밋
06-19
SessionVO.java
첫번째 커밋
06-19
UserVO.java
첫번째 커밋
06-19
rosewiper 06-19 e0c79f9 첫번째 커밋 UNIX
Raw Open in browser Change history
/* * Copyright 2008-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package egovframework.com.cmm; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.util.Scanner; import org.json.simple.JSONObject; import org.json.simple.JSONValue; /** * @Class Name : FacebookAPI.java * @Description : 페이스북 API Class * @Modification Information * @ * @ 수정일 수정자 수정내용 * @ --------- --------- ------------------------------- * @ 2015.04.06 최초생성 * * @author (주)드림웨어 * @version 1.0 * @see * * */ public class FacebookAPI{ private static FacebookAPI facebookAPI = null; private static String CLIENT_ID = "846197678724759"; private static String CLIENT_SECRET="75180f5cd6b38cd21ba7f756566e30e5"; //private static String REDIRECT_URI="http://YOUR_REDIRECT_URI"; private String getAccessToken() { URL url; InputStream is = null; try { url = new URL("https://graph.facebook.com/oauth/access_token" +"?client_id="+CLIENT_ID +"&client_secret=" +CLIENT_SECRET +"&grant_type=client_credentials"); HttpURLConnection request = (HttpURLConnection) url.openConnection(); is = request.getInputStream(); } catch (MalformedURLException e) { // TODO Auto-generated catch block System.out.println("페이스북에러"); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("페이스북에러"); } int result; StringBuffer buffer = new StringBuffer(); Scanner scan = new Scanner(is, "UTF-8"); while(scan.hasNextLine()) { buffer.append(scan.nextLine()); } //String access_token = buffer.substring(13); JSONObject jsonObj = (JSONObject) JSONValue.parse(buffer.toString()); String strAccess_token = jsonObj.get("access_token").toString() ; //System.out.println("access_token : "+access_token); //return access_token; return strAccess_token ; } public String getPosts() { URL url; InputStream is = null; String access_token = getAccessToken(); try { /*url = new URL("https://graph.facebook.com/v2.3/457530414275899/posts" +"?access_token="+access_token +"&locale=ko_KR" +"&limit=10");*/ access_token = "EAAMBnMAM1pcBAPZBlJUe2lP0CkXAbNoAyZBbZAjhZCZBVKI04p6ZA3Bu6z538bvh81IHM2HvZAP77DksglvH3SwJ8Sb0Rw3KTggGI21KYVaiNzshnRY8UOKUX8HpfnhEy1Gyu6ZB1YuDxvQq22KTiZAVpbXycH6x29tnJ6JIGQ6a7gKZAZBbBuvzwHd" ; String fields = "type,picture,from,caption,message,description,story,name,link,permalink_url" ; url = new URL("https://graph.facebook.com/v2.6/457530414275899/feed" +"?access_token="+access_token +"&fields="+fields + "&limit=10" ); HttpURLConnection request = (HttpURLConnection) url.openConnection(); is = request.getInputStream(); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("페이스북에러"); } StringBuffer buffer = new StringBuffer(); Scanner scan = new Scanner(is, "UTF-8"); while(scan.hasNextLine()) { buffer.append(scan.nextLine()); } return buffer.toString(); } public String getPhoto() { URL url; InputStream is = null; try { url = new URL("https://graph.facebook.com/v2.3/457530414275899/picture?redirect=false"); HttpURLConnection request = (HttpURLConnection) url.openConnection(); is = request.getInputStream(); } catch (IOException e) { // TODO Auto-generated catch block System.out.println("페이스북에러"); } StringBuffer buffer = new StringBuffer(); Scanner scan = new Scanner(is, "UTF-8"); while(scan.hasNextLine()) { buffer.append(scan.nextLine()); } return buffer.toString(); } public static FacebookAPI getInstance() { if(facebookAPI==null) { facebookAPI = new FacebookAPI(); } return facebookAPI; } private FacebookAPI() {} }

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
Sign in with github login with Google Sign in with Google
Reset password | Sign up