Sunday, August 11, 2013

“No Items to Review - Stack Overflow” Macro

I will going to show you the constructions of an intermediate automation script using an automation software called AutoIt v3. This tutorial slightly explains how to automate the opening of Internet Explorer, automatically visit “Review First Posts” in a condition, and “Review Late Answers” in new tab and whatever review page(s) of Stack Overflow (all in new tab,) that you want to inject, and reload each one of those web browser's tab and Go to next tab if There are no items for you to review. or An error has occurred. and Go to next tab if the active IE's tab have the review page that you've already finished reviewing its 20 items, and more to make the reviewing of the review items of SO less repetitive!

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

 AutoIt Version: 3.3.8.1
 Author:         Mkt on Net (Marketing on the Internet)
 Link:           http://mktonnet.blogspot.com/

 Title:          “No Review Items - Stack Overflow” Automation
 Script Function:
 Stack Overflow refreshing automation of no items on Review First Posts and Late Answers.

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

#include <IE.au3>

Local $oIE = _IECreate("http://stackoverflow.com/users/login", 0, 0, 0, 1) ; IE OBJECT

Local $oLinks, $oAction = 0, $oString

While 1
   If WinExists("Log In - Stack Overflow") Then
   While 1
   _IELoadWait($oIE)
   $oIE.Visible = 1
   
   $oLinks = _IELinkGetCollection($oIE)
   $oAction = "Logged"
   
   For $oLink In $oLinks
   _IEAttach($oIE, "instance", 1)
   If @Error = 7 Then
      MsgBox(0, "Macro Stopped", "The macro is automatically exit from running.")
      Exit
   EndIf
   
   $oString = StringRegExp($oLink.href, "http://stackoverflow.com/users/login")
   If $oString = 1 AND NOT WinExists("Log In - Stack Overflow") Then
      $oAction = "Redirect"
   EndIf
   Next
   If $oAction = "Redirect" Then
   _IENavigate($oIE, "http://stackoverflow.com/users/login")
   MsgBox(0, "Plese Login", "Please, click the logo to log in with it.")
   ElseIf $oAction = "Logged" And WinExists("Stack Overflow") Then
   _IENavigate($oIE, "http://stackoverflow.com/review/first-posts")
   ExitLoop 2
   EndIf
   WEnd
   ElseIf WinExists("Add Login - Stack Overflow") Then
   $oIE.Visible = 1
   MsgBox(0, "Already Logged In", "You are already logged in.")
   _IENavigate($oIE, "http://stackoverflow.com/review/first-posts")
   If @Error = $_IEStatus_InvalidObjectType Then
   MsgBox(0, "Macro Exited", "The macro is automatically stop running.")
   Exit
   EndIf
   ExitLoop
   ElseIf WinExists("This page can't be displayed") Then
   $oIE.Visible = 1
   MsgBox(0, "The page can't be displayed", "The page with the address of http://stackoverflow.com/users/login can't be displayed.")
   MsgBox(0, "Script Stopped", "The macro will stop running.")
   _IEQuit($oIE)
   Exit
   EndIf
WEnd

While 1
   If WinExists("Review First Posts - Stack Overflow") Then
   ExitLoop
   ElseIf WinExists("This page can't be displayed") Then
   MsgBox(0, "The page can't be displayed", "The page with the address of http://stackoverflow.com/review/first-posts can't be displayed.")
   MsgBox(0, "Macro Stopped", "The script will stop running.")
   _IEQuit($oIE)
   Exit
   EndIf
WEnd

Local $aTitle, $location
$aTitle = WinGetTitle("[active]")

__IENavigate($oIE, "http://stackoverflow.com/review/late-answers", 0, 0x800)
WinWait("Review Late Answers - Stack Overflow")

$location = StringInStr($aTitle, "Review First Posts - Stack Overflow")
If $location == 0 Then
   WinActivate($aTitle)
EndIf

Local $i, $oTabs[1] ; IE GET TABS variables
Local $aTab, $aText, $wActivate, $o = 0

While 1
   Sleep(12000)
   
   _IEAttach($oIE, "instance", 1)
   If @Error = 7 Then
   MsgBox(0, "Script Exited", "The automation script is automatically stop running.")
   Exit
   EndIf
   
; #IE GET TABS# =================================================================================================================
   $i = 1
   While 1
   $oTabs[$i - 1] = _IEAttach($oIE, "instance", $i)
   If @Error = $_IEStatus_NoMatch Then
   $i -= 1
   If $i < 1 Then
   MsgBox(0, "Script Stopped", "The automation script is automatically exit from running.")
   ExitLoop 2
   EndIf
   ReDim $oTabs[$i]
   ExitLoop
   Else 
   $i += 1
   ReDim $oTabs[$i]
   EndIf
   WEnd
; ===============================================================================================================================
   
   $aTab = _IEGetActiveTab()
   $aText = _IEBodyReadText($aTab)
   If @Error = 3 Then
   $location = 0
   Else 
   $location = StringInStr($aText, "There are no items for you to review.")
   $location += StringInStr($aText, "Please try again.")
   $location += StringInStr($aText, "Thank you for reviewing")
   EndIf
   
   If $location > 0 AND UBound($oTabs) > 1 Then
   $aTitle = WinGetTitle("[active]")
   $location = StringInStr($aTitle, "Review")
   
   ControlSend(_IEGetActiveTitle(), "", "", "^{TAB}")
   
   If $location == 0 Then
   $wActivate = WinActivate($aTitle)
   EndIf
   EndIf
   
   If $o = $i OR $o > $i Then
   $o = 0
   EndIf
   
   $aText = _IEBodyReadText($oTabs[$o])
   If @Error = 3 Then
   Exit
   Else 
   $location = StringInStr($aText, "There are no items for you to review.")
   $location += StringInStr($aText, "Please try again.")
   EndIf
   
   If $location > 0 Then
   $oTabs[$o].Refresh
   $o += 1
   Else 
   $o += 1
   EndIf
WEnd

; #FUNCTIONS# ===================================================================================================================
Func _IEGetActiveTitle()
   Local $iIE, $hwnd, $title
   
   _IELoadWait($oTabs[0]) ; IE GET TABS' 1st tab object included
   
   $iIE = _IEAttach($oIE, "instance", 1) ; IE OBJECT included
   
   If @Error = $_IEStatus_Success Then
   $hwnd = _IEPropertyGet($iIE, "hwnd")
   $title = WinGetTitle($hwnd) ; get window title
   EndIf
   
   Return $title
EndFunc

Func _IEGetActiveTab()
   Local $title, $tIE
   
   $title = _IEGetActiveTitle() ; includes _IEGetActiveTitle()
   $tIE = _IEAttach($title, "windowtitle")
   
   Return $tIE
EndFunc
; ===============================================================================================================================

Saturday, July 27, 2013

Learn How to Install an Automation Software

In this tutorial, you will see the guide of installing an automation software on your computer. For more info. about this kind of software, please visit Use an Automation Software to Produce a Macro. The specific software that we will going to install is a freeware, AutoIt v3 which is typically used to produce utility software for Microsoft Windows to automate common tasks:

  1. Download AutoIt Full Installation in AutoIt Downloads - AutoItScript. Internet connection required!
  2. Wait until your download succeed. (Estimated time of downloading: 8 minutes)
  3. After that, "Open" the new downloaded autoit-v3-setup program.
  4. Click "Yes" if your computer system warn you if Do you want to allow the following program to make changes to this computer?
  5. Before starting Setup, it will recommend to close all other applications because it will make it possible to update relevant system files without having to reboot your computer. Just click “Next >” to continue.
  6. You must accept the terms of the agreement by clicking “I Agree” to install AutoIt v3.3.8.1.
  7. Select a default option for *.au3 files.
    • “Run the script” makes the double left-clicking on an .au3 file run it.
    • “Edit the script” makes the .au3 script double left-clicking edit it.
    And click “Next >” to continue.

Friday, July 26, 2013

Use an Automation Software to Produce a Macro

An automation software is designed for creating macros that run to make tasks using an application less repetitive. These macros are also called automation scripts. For more info about these scripts, please visit Run a Script to Make Tasks Less Repetitive.

Most automation software have their own scripting language which is called as their name. For example, the AutoIt3 software can produce an AU3 script with ".au3" file extension, which is written in AutoIt3 language.

The Interface of SciTE-Lite (Version) 2.28 for AutoIt3 The Interface of SciTE-Lite (Version) 2.28 for AutoIt3 (Click the image to enlarge!)

Wednesday, July 24, 2013

Run a Script to Make Tasks Less Repetitive

An automation script (sometimes called a macro) is a small program that automate tasks using an application. A macro is a series of commands and actions that can be saved and run to perform a task. In the former case, macros are used to make tasks using an application less repetitive by automating those tasks that a client perform repeatedly. A macro for automating repetitive tasks, is also called an automation script.

To write a computer program that can perform tasks that's structurally repetitive, you must be a programmer. But I know that you don't want to spend time to be a programer (if your business is about online marketing,) and to spend money to buy an Internet bot, nor to employ a programmer to write a program for your needs. An automation software such as AutoIt (a freeware automation and BASIC-like scripting language) or AutoHotkey (an open-source macro-creation and automation software utility), can be used to produce utility software and automate common tasks. And the best way to get your own customized macro is by using this kind of software, and to study a little bit of the specific scripting language of your automation software, to write your own automation script!

Friday, April 26, 2013

Types of Online Marketing and Promotion

The advertising and promotion of products or services over the Internet is broadly divided into the following types:
  • Affiliate Marketing: An online business that can earn you a commission on every single affiliate that you've made, depend on the affiliate network if the model is based on pay per click (PPC) and cost per impression (CPM/CPI) or cost per action (CPA) or others. Generally, one of those who making this act is a publisher.
  • Content Marketing: The one of the best and effective ways to get some attention from articles or rich blogs or ebooks or news or any kind of media and publishing content which often gets their viewers from search engine results' pages. (SERPs)
  • Display Advertising: Commonly, an advertisement can be ordered in affiliate network with a cost depend on the model such if it have cost per impression (CPI) or have pay-per-click (PPC a.k.a. cost per click) or have cost per action (CPA) or cost per order or mix. But there are still some networks offered a free advertisement such craigslist.
  • Email Marketing: Is different from email spamming. One of the example of this type of promotion is a subscription links where your readers can easily subscribe to your product or your service via e-mail, and not forcing to sent your messages to a group of people using email without their willingness.
  • Referral Marketing: Just a kind of an action to refer someone to specific product or service in any way, either from blog, comment, video or anything. At least you're referring something on the Web, it can be called as an online referral marketing. Referring a business in off-topic way is a kind of a spam!

Sunday, April 21, 2013

Welcome to Online Advertising Strategies

“Mkt. on the Net.” which stands for Marketing on the Internet, is the Internet marketing community, the place for real online marketers that seeks strategies and techniques how to promote a product or a service and not for a spammer which will then lead you to a big disaster, like from getting banned on a network, etc... In this place we will publish blogs about the right way for Internet marketing and promotion in any type, including these following types: