Insert Random Link Into Article

JackedUp

Client
Регистрация
27.06.2012
Сообщения
32
Благодарностей
1
Баллы
8
Hey guys, I'm trying to figure out how to create my 2nd and 3rd Tier web 2.0 templates and could use some help.


I have a .txt file of Links from my 1st Tiers and I have a .txt file of my Spun Articles, but I can't figure out how to design my template so that it pulls a random link from one file, inserts it into a random place in the spun article, then posts it.

Hopefully I've explained that well enough. Any help would be greatly appreciated.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
If you have keywords in your article that you wanna replace, for example dog training, you can use word processing - replace action.

Take random line from URLs list, put to variable var1
Take article body and use replace function:

dog training replace with <a href="{-Variable.var1-}">dog training</a>
 
  • Спасибо
Реакции: gomoney и JackedUp

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
I just thought that your answer had some value.
If honestly that i think my answer is more value that your. Because that replace function can work if you have article in simple format and you know there is keywords what you need to replace. But in most of cases you using spinned articles and you do not know will be there your keyword or not... After all using your method you will post articles without keywords at all...

But with my help user now know that javascript can do that job, and he will look on that closely. And if he will have same questions then we will see that in forum again :-) ;-)

Thanks
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Lol ok :D
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
First of all I wanna say that solution rostonix gave you is simple enough, but wont work fine in that way because you will endup replacing all same keywords with linked keywords, what im sure you dont wanna do... You dont wanna have like 5 linked keywords in article, all pointing to same URL.

You can still use replace function, but you will also need to use some work around using some split and regex, or even javascript. In case you wanna keep it simple, and wanna replace just one keyword in your article, you will need to mark that keyword somehow within txt file.

For example, if your keyword is dog training, you can mark it up in article like this for example <dog training>, and than use replace. This way you will make sure you replace just one keyword. Make sure that you set complete "<dog training>" string into replacement actions block.


Remember, this is simple version, if you wanna get random keyword replacement, more work will be needed, using regex like said before, or javascript.


and lokiys
... I agree with rostonix, put some value or STFU!!!
 
  • Спасибо
Реакции: JackedUp

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Found another solution. For english articles

If you dont mind what word to replace with link and dont mind your text look 100% for humans you can do this:

1) use word processing - regex
Put in body your article, use something like this for regex:

[A-Za-z][A-Za-z][A-Za-z][A-Za-z]*[A-Za-z]
Put all found data to list
Then take random line from this list - put to variable var3

And on replace step replace: {-Variable.var3-} with something like <a href="{-Variable.var1-}">dog training</a>

But you will get sentence like this: "Hello My name is dog training" :D

But who cares :D i can use this even for my tier1 :D
 
  • Спасибо
Реакции: JackedUp

zeus

Client
Регистрация
03.07.2012
Сообщения
99
Благодарностей
21
Баллы
18
I use this regex : (?<=\.).*?(?=\.)
Since we use (.) to separate sentences, i separate it to each sentence then check the first match for the keyword. If not found move to 2nd result,if found replace word.
 
  • Спасибо
Реакции: JackedUp и Daikaiser

JackedUp

Client
Регистрация
27.06.2012
Сообщения
32
Благодарностей
1
Баллы
8
Wow, you guys are a hundred times more advanced than I am at creating templates!

After thinking about it for a little while I came up with this simple way to do it:

1) Create Spun Article file
2) Create Links file (in html format with keywords in spintax)
3) Type in #LINK# somewhere in context of Spun Article
Then in the template...
4) List Processing --> Get Line --> Variable.SpunArticle
5) List Processing --> Get Line --> Variable.Links
6) Word Processing --> Replace --> #LINK# with Variable.Links
7) Word Processing --> Spintax
8-) Post article

But I'm definitely going to try out the different methods you guys suggested. It seems that using Javascript or Regex will create a better, more random, place to insert a link into the article, thereby leaving less of a footprint.

Thank you to everyone that offered their help -- Rostonix, Lokiys, Drvosjeca, Zeus, and Bigcajones! You guys are the best! :az:
 

asteria

Новичок
Регистрация
18.01.2012
Сообщения
24
Благодарностей
3
Баллы
0
I would like to learn how to replace keywords with javascript.
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
After thinking about it for a little while I came up with this simple way to do it:

1) Create Spun Article file
2) Create Links file (in html format with keywords in spintax)
3) Type in #LINK# somewhere in context of Spun Article
Then in the template...
4) List Processing --> Get Line --> Variable.SpunArticle
5) List Processing --> Get Line --> Variable.Links
6) Word Processing --> Replace --> #LINK# with Variable.Links
7) Word Processing --> Spintax
8-) Post article

Let me first tell you that you didnt come up with nothing new, that is same as i stated in previouse post, when i said that keyword should be marked "<dog training>" no difference than your #LINK#...

second, i would suggest you to do spinning part before you do "replace" ...otherwise you will always need to doublecheck your article if you maybe inputed replace element inside spin string, which means you might endup with no link after spinning ;-)
 
  • Спасибо
Реакции: JackedUp

Кто просматривает тему: (Всего: 2, Пользователи: 0, Гости: 2)