Author Topic: howto: thread sucker  (Read 795 times)


  • Full Member
  • ***
  • Joined: Dec 2010
  • Posts: 218
howto: thread sucker
« on: March 23, 2016, 04:34 pm »
Hi guys,

i want to share with you the knowledge how to get thread sucker to work.

idThis is like the "host label" and identifies a "thread sucker" entry.
Please keep the same naming convention as it is for "host label".
urlpatternFirst part to activate the thread sucker.
If matching and searchpattern would returning a result url, the entry will be active in the right-click menu.
In case the your solution is not returning something valid the entry will stay disabled.
searchpatternSecond part to activate the thread sucker.
You need to build a url for each page and return it, then this page will be searched for pictures.
The code will be run as many pages you want, depending on what you enter in the dialog boxes.
E.g. first page 1 and last page 3, it will be executed three times to build the page urls.

threadsucker_Globals.linkIndex is the variable we can access to use the current number.
In our example it will be 1 at the first time, 2 for the second run, and 3 for the last run.

let's have a look on an example:
Code: [Select]
<forum id="eroticity">
<searchpattern><![CDATA[function(threadURL) {
    return threadURL.match(/http.+\//) + "page" + (threadsucker_Globals.linkIndex);   

IHG will check the current url to see if urlpattern is matching, if not end of task.
If so the "thread sucker" entry will get active.

If you go on this page:
The "thread sucker" will be active, because the urlpattern is matching.

When you now run the thread sucker and give 1 as first page and 3 as last page it will do the following:

Code: [Select]
threadURL.match(/http.+\//)Get the Url but without the last part, in our case "page2".
Code: [Select]
+ "page"add "page"-text to the url.
Code: [Select]
+ (threadsucker_Globals.linkIndex)Now add the first loop value, in our case 1, because first page is 1.

The function will return:

loop   .   returned url
1   .
2   .
3   .
4   .   We reached our "last page" so IHG will stop generating urls.
Otherwise it would continue until the "last page" has reached.

Please note that which each loop the page-number is increased by 1.
In case there is another number logic for pages, you need to address this within your code.

These links will be visited by IHG and searched for pictures using the rules in host file editor.
After all generated urls have been visited all found pictures will be queued and downloaded by IHG.

After changes in forum_styles.xml it is necessary to restart your browser.
Thank you SenileDog for pointing that out.

I hope this guide helps you!

If you have questions post em here and i try to answer when possible.

Question   .   Answer
-   .   -

Feedback is appreciated :)


P.s. This knowledge is based on my experience with the thread sucker.

16/04/02: Final version.
« Last Edit: April 02, 2016, 10:31 am by Firewaran »


  • Manager
  • *****
  • Joined: Jan 2013
  • Location: On the Ethernet
  • Posts: 1305
Re: howto: thread sucker
« Reply #1 on: March 23, 2016, 06:35 pm »
Good work! Thank you for your contributions!

In the not too distant future I intend to move the forum_styles.xml file into a database similar to hostf.xml as present. Then we can have a download page where users can download the latest forum_styles.xml and copy it into their IHG directory.

Unfortunately IHG has no means of uploading this file through its interface so the file must be copied manually, but perhaps at some point we can add an update feature that operates similar to our hostf.xml updates.

In any case all the latest solutions will be available in one spot, and revision controlled to make sure all users can get the latest version.


  • Full Member
  • ***
  • Joined: Jun 2015
  • Posts: 130
Re: howto: thread sucker
« Reply #2 on: April 01, 2016, 07:16 pm »
Yes, great job, Firewaran. :thumbsup:

Just wanted to add:

When I add a new host to forum_styles.xml, I have to restart PM or FF, to activate the suck the current thread menu item.


  • Manager
  • *****
  • Joined: Jan 2013
  • Location: On the Ethernet
  • Posts: 1305
Re: howto: thread sucker
« Reply #3 on: April 01, 2016, 10:59 pm »
We appreciate Fire's contribution to this subject and intend to add it to our How-To section when Fire has finalized it.