How to generate email facebook

Discussion in 'Plugin Development' started by Batman500, Jun 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Batman500

    I am new to java and I still have no knowledge about connections, I would like to know how he could generate the email of the last person who likes my page

    Example
    This code generates the recent amount
    Code:java
    1. public static String getLikes(String url) throws MalformedURLException, IOException {
    2. InputStream is = new URL(url).openStream();
    3. try {
    4. Charset.forName("UTF-8")));
    5. String jsonText = readAll(rd);
    6.  
    7. StringBuilder builder = new StringBuilder();
    8.  
    9. boolean found = false;
    10. boolean afound = false;
    11. boolean bfound = false;
    12. boolean cfound = false;
    13. boolean dfound = false;
    14. boolean efound = false;
    15. boolean ffound = false;
    16.  
    17. for (int i = 0; i < jsonText.length(); i++) {
    18. char c = jsonText.charAt(i);
    19. if ((c == ',') || (c == '}')) {
    20. found = false;
    21. afound = false;
    22. bfound = false;
    23. cfound = false;
    24. dfound = false;
    25. efound = false;
    26. ffound = false;
    27. }
    28. if (ffound) {
    29. builder.append(c);
    30. }
    31. if ((c == 'l') &&
    32. (!found)) {
    33. found = true;
    34. }
    35.  
    36. if ((c == 'i') &&
    37. (!afound) &&
    38. (found)) {
    39. afound = true;
    40. }
    41.  
    42. if ((c == 'k') &&
    43. (!bfound) &&
    44. (afound)) {
    45. bfound = true;
    46. }
    47.  
    48. if ((c == 'e') &&
    49. (!cfound) &&
    50. (bfound)) {
    51. cfound = true;
    52. }
    53.  
    54. if ((c == 's') &&
    55. (!dfound) &&
    56. (cfound)) {
    57. dfound = true;
    58. }
    59.  
    60. if ((c == '"') &&
    61. (!efound) &&
    62. (dfound)) {
    63. efound = true;
    64. }
    65.  
    66. if ((c == ':') &&
    67. (!ffound) &&
    68. (efound)) {
    69. ffound = true;
    70. }
    71.  
    72. }
    73.  
    74. return builder.toString();
    75. } catch (Exception e) {
    76. e.printStackTrace();
    77. }return null;
    78. }
     
  2. Batman500 I think you're confused. This is Bukkit, not Facebook
     
  3. Offline

    Batman500

    AdamQpzm The plugin is for bukkit, I need to collect the mail is not to create fakes
     
  4. Offline

    NathanWolf

    Are you trying to make a Bukkit plugin that interacts with the Facebook API?

    If so, I'd suggest using a wrapper, like this one:

    http://facebook4j.org/en/index.html

    There are a lot of intricacies in dealing with app keys and secrets to be able to access the API that a wrapper will handle for you. You at least should get a real JSON parser!

    From there, you should go to the FB (or wrapper) API docs to see the specific query you need to retrieve likes and look up players' email addresses (for which they will need to have given permission to your FB app!)

    Facebook is an ecosystem all in itself- if you're not experienced with using its API, you should seek help on FB-specific channels first, I think.
     
  5. Batman500 This is for support regarding the Bukkit API. While we do stretch that to include general Java questions when the person is creating a plugin (except for the basics of course - that's met with the response that they need to learn Java first) what you're doing isn't at all related to the Bukkit API, and is even dependent on a third-party thing. The fact that you intend to utilise this in a bukkit plugin does not mean it's a bukkit question.
     
    AoH_Ruthless likes this.
  6. Offline

    NathanWolf


    Well it's not like we don't often give non-Bukkit-specific help on here :)

    I agree he'd be better off seeking help elsewhere for the Facebook-specific issues, but they don't usually deal with Java so there's a bit of a knowledge gap there. (Venn diagram needed)

    Posting here for this isn't something he should be bashed for, though. As per usual, if you can't help, just don't reply ;)

    For instance, he happens to have randomly found an ex backend engineer for a large Facebook game (me). He lucked out a bit there, and I may not pay enough attention to help him out, but I can hopefully at least push him in the right direction :D
     
  7. NathanWolf If there are communities aimed at providing help for the non-bukkit thing, then that's the best place. And we do, but it's not normally for something so detached.
     
  8. Offline

    NathanWolf


    There aren't great communities for getting help with interacting with FB via Java, and it's actually pretty complex. I'm just saying, give the poor guy a break? :)
     
    Konkz likes this.
  9. Offline

    Konkz

    If this forum was 100% dedicated to Bukkit API related questions then 80% of threads posted would not be here. Most of the questions are related a lot to Java and sometimes contain 1 part of the Bukkit API, being "Listen to x event". Rest are simply: loop through players using a for loop. Make an arraylist or hashmap etc.

    He is seeking help to a project that is related to Bukkit therefore why can't we provide him help but we provide everyone else help?

    If you can't help don't reply and simply move on, we're here to help overall.
     
    NathanWolf likes this.
Thread Status:
Not open for further replies.

Share This Page