public static void SendMessages(string Token, int accountIndex, int postIndex, string message, int messageStartIndex, int messageEndIndex) { var client = new FacebookClient(Token); Page page = GraphCalls.getPage(client, accountIndex); var pageClient = new FacebookClient(page.access_token); Post post = GraphCalls.getPost(pageClient, page, postIndex); List <Comment> comments = GraphCalls.getComments(pageClient, post); GraphCalls.sendMessages(pageClient, comments, message, messageStartIndex, messageEndIndex); }
static void Main(string[] args) { // Tyler's login credentials /************************************************************************** * STEP 1 * RUN AllAccounts * SET accounIndex * * STEP 2 * RUN AllPosts to see which post you want to use * SET postIndex * * STEP 3 * SET message to you're custom message. * check GraphCalls.sendMessages for how message is created with user name * * STEP 4 (optional) * Run GetMessages and find the messageIndex you wish to start at * SET messageIndex * * STEP 5 * Run program! * ****************************************************************************/ string message = "! You won our Pokemon Keychain Giveaway! Thank you for engaging in our community. Our friends over at Movie Treasures are sponsoring this event and want to give you 3 FREE keychains of your choice! \n\n" + "How to Claim Your Prize: \n\n" + "1. Follow Our Link >\n" + "https://movietreasures.org/collections/anime-lovers/products/premium-quality-pokemon-keychains \n\n" + "2. Add Any 3 Keychains to Your Cart \n\n" + "3. Enter Coupon Code 'WINNER5' at Checkout \n\n" + "4. Hurry! We Can Only Secure Your Exclusive Offer For 24 Hours! \n\n" + "** Checkout the Movie Treasures FAQs page for answers to common questions \n\n" + "https://movietreasures.org/pages/faqs-2 \n\n" + "** Free shipping available in select regions only, all rates are discounted, but ultimately determined by location"; message = "! Thank you for your support."; int accountIndex = 2; int postIndex = 23; int messageStartIndex = 0; // default = 0 int messageEndIndex = int.MaxValue; // default = int.MaxValue string Token = "EAAGsVkZAMInsBACm7nZCoCEV0bko7EUbJcBX1KsSC5m8azC9UVEWuYdVR0WtZBqg3H6nUu2Sy9JSECZC0OGv6KNCHTdgDcZAkcbrrOKiJfhVjxkv2hRvZCibn3cKZC5O65QYc0XAFrpYReuoZApPSqqtUcKSE0Be5tdOHohSQBGFjQZDZD"; var client = new FacebookClient(Token); Page page = GraphCalls.getPage(client, accountIndex); GraphCalls.AllAccounts(client); List <Post> posts = GraphCalls.AllPosts(page); SendMessages(Token, accountIndex, postIndex, message, messageStartIndex, messageEndIndex); }