Skip to content

Commit 6b05407

Browse files
committed
.
1 parent 2c60781 commit 6b05407

File tree

10 files changed

+62
-47
lines changed

10 files changed

+62
-47
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SEO Backlinking App
1010
- Submits backlinks to indexing services
1111
- Additional services can be added through simple command steps
1212

13-
[00c3cdf7]: http://backlinksindexer.com/ "Preferred"
13+
1414
## Prerequisites
1515
- [NodeJS][ca1dffb7] v4.4.7 or greater
1616
- [PhantomJS][6997c770] v2.1 or greater

app/console-xtra.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ exports.log = (msgColor, msg) ->
3333
code: '\x1b[37m'
3434
}
3535
]
36-
colorCode = ''
36+
colorCode = ''
3737
for i in [0...colorsANSI.length]
3838
if msgColor == colorsANSI[i].text
3939
colorCode = colorsANSI[i].code

app/imports.coffee

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fs = require('fs')
2-
colors = require('colors')
2+
consolex = require('./console-xtra')
33

44
exports.accounts = (filePath) ->
55
# Load accounts.csv
@@ -103,12 +103,16 @@ exports.indexers = (filePath) ->
103103
status = 'status'
104104
else if status == 'name'
105105
tempIndexers[a].name = temp
106+
status = ''
106107
else if status == 'username'
107108
tempIndexers[a].username = temp
109+
status = ''
108110
else if status == 'password'
109111
tempIndexers[a].password = temp
112+
status = ''
110113
else if status == 'status'
111114
tempIndexers[a].status = temp
115+
status = ''
112116
ins.close()
113117
a = 0
114118
temp2 = 0

app/imports.js

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/spinner.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fs = require('fs')
2-
colors = require('colors')
2+
consolex = require('./console-xtra')
33

44
# -------------------- Get random account ----------------------------
55

@@ -122,5 +122,5 @@ exports.getArticle = (articles, microBlog, noHTML) ->
122122
temp3 = newArticle.body.slice(randomPos, temp)
123123
newArticle.body = temp1 + temp2 + temp3
124124

125-
console.log ('Created article: ' + newArticle.title).magenta
125+
consolex.log 'magenta', 'Created article: ' + newArticle.title
126126
newArticle # Return the article to submit

app/spinner.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

open-submitter.coffee

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fs = require('fs')
22
system = require('system')
3-
colors = require('colors')
3+
consolex = require('./app/console-xtra')
44
imports = require('./app/imports')
55
spinner = require('./app/spinner')
66
page = require('webpage').create()
@@ -13,20 +13,20 @@ casper = require('casper').create(
1313
waitTimeout: 60000 # 1 min default wait timeout
1414
verbose: true
1515
onError: (self, msg) ->
16-
console.log ('FATAL:' + msg).red
16+
consolex.log 'red', 'FATAL:' + msg
1717
self.exit()
1818
return
1919
onTimeout: (self, msg) ->
2020
@.capture('./capture/timeout.png')
21-
console.log ('general timeout error: ' + msg).red
21+
consolex.log 'red', 'general timeout error: ' + msg
2222
return
2323
onStepTimeout: (self, msg) ->
2424
@.capture('./capture/timeout.png')
25-
console.log ('step timeout error: step ' + msg).red
25+
consolex.log 'red', 'step timeout error: step ' + msg
2626
return
2727
onWaitTimeout: (self, msg) ->
28-
@.capture('./capture/timeout.png')
29-
console.log ('wait timeout error: ' + msg).red
28+
@.capture ('./capture/timeout.png')
29+
consolex.log 'red','wait timeout error: ' + msg
3030
return
3131
)
3232

@@ -39,11 +39,11 @@ fileBacklinks = './backlinks/' + casper.cli.get(2) + '.txt'
3939
numPosts = casper.cli.get(3)
4040

4141
console.log '\n'
42-
console.log '---------------- Submission Details ----------------------'.cyan
43-
console.log ('Accounts file: ' + fileAccounts).cyan
44-
console.log ('Articles file: ' + fileArticles).cyan
45-
console.log ('Backlinks saved to file: ' + fileBacklinks).cyan
46-
console.log ('Number of Submissions: ' + numPosts).cyan
42+
consolex.log 'cyan', '---------------- Submission Details --------------------'
43+
consolex.log 'cyan', 'Accounts file: ' + fileAccounts
44+
consolex.log 'cyan', 'Articles file: ' + fileArticles
45+
consolex.log 'cyan', 'Backlinks saved to file: ' + fileBacklinks
46+
consolex.log 'cyan', 'Number of Submissions: ' + numPosts
4747

4848
currentService = 0
4949
currentStep = 0
@@ -123,7 +123,7 @@ casper.doStep = (objStep, serviceName) ->
123123
submitArticle = spinner.getArticle(articles, objStep.micro,objStep.noHTML)
124124
randomAccount = spinner.getAccount(accounts, serviceName)
125125
str = '-------------- Submit to ' + serviceName+' ----------------'
126-
console.log (str).yellow
126+
consolex.log 'yellow', str
127127
# -------------------------- Open ---------------------------------------
128128
else if objStep.command == 'open'
129129
@echo 'Opening url '+objStep.url+'...'
@@ -255,17 +255,17 @@ casper.doStep = (objStep, serviceName) ->
255255
if objStep.confirm
256256
@waitForSelector objStep.confirm,
257257
->
258-
@echo 'Confirmed.'
258+
@echo 'Found confirm selector.'
259259
->
260260
@echo 'Confirm DOM selector not found', 'ERROR'
261261
errorMsg()
262262
@capture('./capture/error.png')
263263
if objStep.confirmtxt
264264
@waitForText objStep.confirmtxt,
265265
->
266-
@echo 'Confirmed: ' + objStep.confirmtxt
266+
@echo 'Found confirm text: ' + objStep.confirmtxt
267267
->
268-
@echo 'Confirm text not found', 'ERROR'
268+
@echo 'Confirm text' + objStep.confirmtxt + 'not found', 'ERROR'
269269
errorMsg()
270270
@capture('./capture/error.png')
271271
else
@@ -334,7 +334,7 @@ casper.doStep = (objStep, serviceName) ->
334334
if @exists(tempObj)
335335
submitURL = @getElementAttribute tempObj, 'href'
336336
backlinksList += submitURL + '\n'
337-
console.log ('Submitted post to URL: ' + submitURL).cyan
337+
consolex.log 'cyan', 'Submitted post to URL: ' + submitURL
338338
# Save backlinks.txt
339339
try
340340
fs.write fileBacklinks, submitURL, 'a'
@@ -364,12 +364,15 @@ casper.repeat numLoops, ->
364364
++currentStep
365365
if currentStep == service[currentService].steps.length
366366
serviceName = service[currentService].name
367-
console.log ('Completed submit to '+serviceName + '\n').green
367+
consolex.log 'green', 'Completed submit to '+serviceName + '\n'
368368
++currentService
369369
currentStep = 0
370370
return
371371
return
372372

373+
casper.then ->
374+
consolex.log 'blue', 'Submitting links to indexeing services'
375+
373376
casper.repeat numIndexerLoops, ->
374377
@then ->
375378
if currentIndexer < indexers.length
@@ -382,7 +385,7 @@ casper.repeat numIndexerLoops, ->
382385
currentIndexerStep = 0
383386

384387
casper.run ->
385-
console.log ('Finished all submissions.').green
388+
consolex.log 'green', 'Finished all submissions.'
386389
@echo 'Press ctrl C to exit'
387390
@exit(0)
388391
@bypass(1)

open-submitter.js

Lines changed: 22 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/services.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ ok
55
#name#
66
blogdotcom
77
#status#
8-
ok
8+
bad

0 commit comments

Comments
 (0)