Jump to content
UBot Underground

splitting text into variables?


Recommended Posts

Hi,

Lets say i have a text that is of HTML.

 

what I want to do is seperate each line/setence/paragraph and set them as a variable.

 

lets say i have an article thats 10 paragraphs ( in html )

 

I want it to seperate each paragraph (based on a tag ex. *NEWPARAGRAPH* seperates each pargraph so split on each *NEWPARAGRAPH* tag) and post each seperate paragraph to a site ( or save it )

 

i havnt started/tried making this yet, but i know i have no clue thats why im asking first, but thats the basic theory.

 

any input would help thanks

Link to post
Share on other sites

I really could use something like this too. Example: I pull a phone number from a list (321-654-7894) and I need to post it into a 3 text box phone number screen. Taking the information as it is in the list which cant be easily edited wouldn't be able to be put into those fields.

Link to post
Share on other sites

You can split it into a list using $list from text. For the phone number example, you can just split it by - as the delimiter. For a paragraph, you may have to delimit by "</p><p>" or something similar (depends on what your html looks like)

Link to post
Share on other sites

You can split it into a list using $list from text. For the phone number example, you can just split it by - as the delimiter. For a paragraph, you may have to delimit by "</p><p>" or something similar (depends on what your html looks like)

 

 

Okay not sure i 100% understand but ill try it out now and let you know. thanks

Link to post
Share on other sites

Alright. So i have my HTML in a block text with the varialbe #Content

 

then I set #parseparagraphs as the variable and then list from text #Content deliminator <>

 

i then have ui stat monitor for #parseparagraphs and its only showing the first paragraph instead of all of em.

 

I dont see how im supposed to seperate each paragraph and make it post each paragraph seperately.

Link to post
Share on other sites

Alright. So i have my HTML in a block text with the varialbe #Content

 

then I set #parseparagraphs as the variable and then list from text #Content deliminator <>

 

i then have ui stat monitor for #parseparagraphs and its only showing the first paragraph instead of all of em.

 

I dont see how im supposed to seperate each paragraph and make it post each paragraph seperately.

My laptop with UBot on it is off for repairs (fried gfx card :(), so I'll try to explain how I would do this in text:

 

+ clear list
+-- %paragraphs

+ add to list 
+-- %paragraphs
+-+ $list from text
 +-- "Blah<!--delimiter-->Blah2<!--delimiter-->Blah3<!--delimiter-->Blah4"
 +-- "<!--delimiter-->"
 +-- "Yes"

+ loop
+-+ $list total
| +-- %paragraphs
|
+-+ set
| +-- #this_paragraph
| +-+ $next list item
|   +-- %paragraphs
|
+-+ (your posting code here, using #this_paragraph)
|
+(end of loop)

(don't include quotes)

Link to post
Share on other sites

My laptop with UBot on it is off for repairs (fried gfx card :(), so I'll try to explain how I would do this in text:

 

+ clear list
+-- %paragraphs

+ add to list 
+-- %paragraphs
+-+ $list from text
 +-- "Blah<!--delimiter-->Blah2<!--delimiter-->Blah3<!--delimiter-->Blah4"
 +-- "<!--delimiter-->"
 +-- "Yes"

+ loop
+-+ $list total
| +-- %paragraphs
|
+-+ set
| +-- #this_paragraph
| +-+ $next list item
|   +-- %paragraphs
|
+-+ (your posting code here, using #this_paragraph)
|
+(end of loop)

(don't include quotes)

 

 

that looks perfect! thanks man i'll try and report back! appreciate it

Link to post
Share on other sites

This might better explain...

 

Lets say i have ONE giant article with 100s of paragraphs in it.

 

 

I paste the article into a UI block text

 

now lets say i have each paragraph split buy " <SPLIT>

 

I want it to get the first paragraph. post it.

 

go to the next split. post it.

 

the next split. post it. and on and on.

Link to post
Share on other sites

I don't have the exact code for you, but I would build this in a very modular fashion... tackle one small part at a time. First, figure out the parsing by <split> portion. I would expect this will require use of the regex functions in UBot... regex is a nightmare for me but it's one of the absolute most powerful things you can master.

 

Once you have a simple bot/sub that does nothing but parse the input into chunks, then build the posting part and feed those chunks to it in a loop.

 

I don't know if that helps but it's the approach I would take...

 

Jonathan

Link to post
Share on other sites

I don't have the exact code for you, but I would build this in a very modular fashion... tackle one small part at a time. First, figure out the parsing by <split> portion. I would expect this will require use of the regex functions in UBot... regex is a nightmare for me but it's one of the absolute most powerful things you can master.

 

Once you have a simple bot/sub that does nothing but parse the input into chunks, then build the posting part and feed those chunks to it in a loop.

 

I don't know if that helps but it's the approach I would take...

 

Jonathan

 

well thanks for a reply, but doesnt really help me out. I do know how to program so i understand how it SHOULD be done. My point is I dont know and cant figure out how to do this with UBOT. been asking for days now and seems like noone knows...

Link to post
Share on other sites

Gotcha... well having not tackled this one myself yet I'm afraid I don't know a definite answer. At least not all within UBot.

 

On possibility... in another thread we've been discussing the use of PHP for certain backend operations. The kind of thing you're talking about is really easy to do in PHP. You could have UBot pass the article to a PHP page you control, which would then parse it, split it up, and return the results in a way that UBot could grab again. Maybe that would be one solution?

 

Jonathan

Link to post
Share on other sites

Gotcha... well having not tackled this one myself yet I'm afraid I don't know a definite answer. At least not all within UBot.

 

On possibility... in another thread we've been discussing the use of PHP for certain backend operations. The kind of thing you're talking about is really easy to do in PHP. You could have UBot pass the article to a PHP page you control, which would then parse it, split it up, and return the results in a way that UBot could grab again. Maybe that would be one solution?

 

Jonathan

 

It would be a solution if i knew php :D

I code in vb.net

Link to post
Share on other sites

@ Earthling >> Would you mind explaining EXACTLY what it is you're trying to do? I don't mean like an example like the one listed above

Lets say i have ONE giant article with 100s of paragraphs in it.

 

 

I paste the article into a UI block text

 

now lets say i have each paragraph split buy " <SPLIT>

 

I want it to get the first paragraph. post it.

 

go to the next split. post it.

 

the next split. post it. and on and on.

 

I mean, literally explain what you're trying to do. For example:

 

"I'm trying to go to examplesite1.com and pull a paragraph. Then go to examplesite2.com and pull another paragraph and do that for 10 sites. Then, go to my site and post each pulled paragraph as an individual blog post." <-- something like that...I mean LITERALLY what are you trying to do? I might be able to help.

Link to post
Share on other sites

@ Earthling >> Would you mind explaining EXACTLY what it is you're trying to do? I don't mean like an example like the one listed above

 

I mean, literally explain what you're trying to do. For example:

 

"I'm trying to go to examplesite1.com and pull a paragraph. Then go to examplesite2.com and pull another paragraph and do that for 10 sites. Then, go to my site and post each pulled paragraph as an individual blog post." <-- something like that...I mean LITERALLY what are you trying to do? I might be able to help.

 

 

im not trying to scrape and post, that would be extremly easy and i know how to do that.

Like i said.. i have 1 giant article that is split into paragraphs by <hr>

I want to be able to copy and paste that FULL article into a textbox ( or load it ) and then have it go to my BLOG and post each paragraph as a seperate post..

Link to post
Share on other sites

Alright, I've attached the compiled .exe code to this post. I'll embed the video here and you can watch it as soon as it is finished being "processed" by youtube. Whatever doesn't make sense to you in the bot will be explained in the video. You can view the video now, but the quality won't be good enough for you to read the text for about another 8 minutes.

 

.EXE File: http://rapidshare.com/files/326843597/blog_poster.exe.html

 

http://www.youtube.com/watch?v=5_PchZBGyTE

Link to post
Share on other sites

The one thing you'll notice it's doing, is just using < as the delimiter, and is then including the hr. (the . is the lowercase version of >). So, you might have to use a one character delimiter (like only the < for example) and then it would work perfectly (I think, I'm not entirely sure this is what you were looking for).

Link to post
Share on other sites

It would be a solution if i knew php :D

I code in vb.net

 

Ah yes, minor detail. =) Still the VB version shouldn't be tremendously different in concept. But let's see what crazyfix has come up for you first... I'm intrigued. ;)

 

Jonathan

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...