diff options
author | Vitaly Takmazov | 2018-10-23 21:48:21 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-23 21:48:21 +0300 |
commit | ee62ef1659604a373cb1c94d3cf0b1a6fd3946e8 (patch) | |
tree | 961903fb3f974aa7a9c1fdebb93e379a64449e2e /juick-server/src/main/java/com/juick/server/FacebookPageManager.java | |
parent | aa2a16145a084290cae1b4c8934a19abfbd7ac5d (diff) |
Drop Facebook and Messenger apps
Facebook forbids autoposting since 1 August 2018
Messenger bot requires LLC
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/FacebookPageManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/FacebookPageManager.java | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/juick-server/src/main/java/com/juick/server/FacebookPageManager.java b/juick-server/src/main/java/com/juick/server/FacebookPageManager.java deleted file mode 100644 index 971b206c..00000000 --- a/juick-server/src/main/java/com/juick/server/FacebookPageManager.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.juick.server; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.util.UriComponents; -import org.springframework.web.util.UriComponentsBuilder; - -@Component -public class FacebookPageManager { - private static Logger logger = LoggerFactory.getLogger(FacebookPageManager.class); - @Value("${facebook_page_id:12345678}") - private String pageId; - @Value("${fb_page_access_token:12345678}") - private String accessToken; - - public void post(String status, String link) { - UriComponents uriComponents = UriComponentsBuilder.fromUriString("https://graph.facebook.com/{page_id}/feed") - .queryParam("message", status) - .queryParam("link", link) - .queryParam("access_token", accessToken) - .buildAndExpand(pageId); - RestTemplate api = new RestTemplate(); - ResponseEntity<String> response = api.exchange(uriComponents.toUri(), - HttpMethod.POST, null, String.class); - logger.info("Facebook response: {}", response.getBody()); - } -} |