Jump to content

Give me an example script for posting on my 3 different Facebook pages..


Servant
 Share

Recommended Posts

I already spend two days by reviewing AutoIt Documentation and I still don't know what to do..

Would you please give me a full example script how to do these steps:

  1. Start the AutoIt script.
  2. A customized GUI will now appear.
  3. I will input the 3 URLs of my Facebook pages on the GUI and save them!
  4. Now I will log in my Facebook account manually.
  5. Post a photo with message on the GUI.
  6. The content will now start posting on my 3 different FB pages.
  7. When it's finish, I will click "Close" on the GUI but the 3 URLs will be saved.
  8. And then the script will now be exited.
  9. But when I open it again the 3 URLs of my pages will still be there!

If you can't provide me this hard thing, just please refer me to the specific example scripts that matches those actions.

I'm really tired right now and I think, this is the right time to ask for a help.

Anyway, thanks for any help..

Edited by Servant
Link to comment
Share on other sites

After reading the documentation, what have you tried so far?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

After reading the documentation, what have you tried so far?

Here, but this is so unfinished and just a test (I also want to reconstruct it to the steps that I've wanted):

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.8.1
 Language:       English
 Author:         Mark Anthony B. Dungo
 Website:        http://developingsites.blogspot.com

 Script Function:
    Instantiate the posting to all of your handle Facebook pages.

#ce ----------------------------------------------------------------------------

; Script Start
#include <IE.au3>

; Create an IE Object
Local $oIE = _IECreate("https://www.facebook.com/", 0, 1, 1, 1)

; Read the text in IE Body
Local $oText = _IEBodyReadText($oIE)
Local $location = StringInStr($oText, "Sign Up")

If $location > 0 Then
   _IENavigate($oIE, "https://www.facebook.com/login.php", 1)
   MsgBox(0, "Facebook", "Please log in first.")
Else
;   GUICreate("Facebook Pages' Poster")
;   GUISetState(@SW_SHOW)
   _IENavigate($oIE, "https://www.facebook.com/TheAdmins", 1)
EndIf

$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
Sleep(5000)

$oForm = _IEGetObjById($oIE, "u_0_3g")
$oQuery = _IEFormElementGetObjByName($oForm, "xhpc_message")
; $oSubmit = _IEFormElementGetValue($oForm, "1")
; _IEAction($oQuery, "click")
_IEFormElementSetValue($oQuery, "TEST")
; _IEAction($oSubmit, "click")

MsgBox(0, "Script End", "The end of our test.")

It looks like the command _IEFormElementSetValue($oQuery, "TEST") was once worked at the first time that I test it, but not on the next time around thinking Facebook knows that this command is trying to manipulate their code. But not so sure about it..

Maybe you are trying to do this the long way around, automating the web page ? A better way would be to study the Facebook API, or just to see some simple example ? You can use/call Curl directly from AutoIT - and achieve what you want without making it over-complicated.

Is using Curl the standard for manipulating web pages? Or just using automation software such as AutoIt is the standard one?

What I mean is I don't want to use such as other artificial method for manipulating pages. And also, nice link but it looks like not updated.

Edited by Servant
Link to comment
Share on other sites

No, Curl is not the "standard" for manipulating web pages, but one of many ways to achieve the goal. I just personally like to get the job done easily, even if it involves having a call to a small external utility. As in "do not re-invent the wheel". Just my personal taste.

I am just a hobby programmer, and nothing great to publish right now.

Link to comment
Share on other sites

If you can't identify the form then you need to try the API.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I already spend two days by reviewing AutoIt Documentation and I still don't know what to do..

 

Would you please give me a full example script how to do these steps:

  • Start the AutoIt script. Simple enough. Just run the exe or run from SciTE.
  • A customized GUI will now appear. Make a GUI with Koda - Koda is part of the toolbox when you install the full AutoIt suite
  • I will input the 3 URLs of my Facebook pages on the GUI and save them! Save the URLs to an INI file. Many examples in the helpfile and in the forum on how to do this
  • Now I will log in my Facebook account manually. Manual process - no coding needed (question - You have 3 browser windows open to handle the 3 accounts? Or do you use the "Managing Ads & Campaigns" functionality? Some type of process map on how you do this part here would help.
  • Post a photo with message on the GUI. Have two fields on the GUI - one for the input text and one to point to the picture file you are uploading
  • The content will now start posting on my 3 different FB pages.How do you want to cycle through the pages? is it sent to all 3 pages at once or cycles through them?
  • When it's finish, I will click "Close" on the GUI but the 3 URLs will be saved. Simple enough. Save URL to INI. Have a button called "Closed" on the GUI.
  • And then the script will now be exited. simple - script will exit
  • But when I open it again the 3 URLs of my pages will still be there! On restart the GUI will first read the INI for the last three URLs used.
If you can't provide me this hard thing, (We like to teach people to fish, not give you fish) just please refer me to the specific example scripts that matches those actions. (what is called out in red will give you PLENTY of direction. You will need to show us some code on what you have tried in order for us to help you further.)

I'm really tired right now and I think, this is the right time to ask for a help. Get some sleep, clear your brain, and come back when you are fresh. Odds are this will be MUCH easier for you then! :)

Anyway, thanks for any help..

Your welcome - and welcome to the forum!

Link to comment
Share on other sites

  • Moderators

Servant, this is a forum for assisting people with their own scripts. We lean toward the "teach a man to fish" motto, rather than spoon-feeding you code. Please show us the work you have put in, based on Yogi's suggestions, and explain where it is failing. Help us help you ;)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

 

 

I want to make an app that can publish post to many of my handle pages at the same time but if it's against the Facebook rules then I'll go to publish one by one. I'm now learning Facebook API and I don't want my FB app to become blocked in the future.

Is there any FB violation when I try to publish a single post e.g. to my 10 handle pages at the same time using my created app?

I'm now on my way, please help..

Link to comment
Share on other sites

  • Moderators

Is there any FB violation when I try to publish a single post e.g. to my 10 handle pages at the same time using my created app?

 

Would this not be something better asked of FB support, or worth you looking through the site's TOS yourself?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

I hope I'm not speaking out of turn here but I think I can safely say this:

If it is against the TOS of Facebook then I would think this thread will be closed as well by a moderator. The reason being is we try not to run afoul of other sites TOS.

In doing a quick google I believe it is not against their TOS.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...