Jump to content
UBot Underground

Converting Category Number To Category Name For Display


Recommended Posts

I am scraping a site and want to show the current category in the UI. Right now I have it showing the category number but that does not really tell the person looking at the bot much of anything. What I want to display is the actual category that matches each number. 

 

Been thinking about it a bit and all the ways that come to me seem to be convoluted enough to be somewhat ludicrous and I figure there is probably a fairly simple way I am missing.  If someone could point me in the right direction that would be great. 

 

Thanks

Link to post
Share on other sites

I think I know what site you're talking about and if I'm right I can't tell you why it's like that since it was a long time ago but probably to save time ;)

 

You can just create a very long if then statement that says if the category number = 20 or whatever number then set a variable to be the name to be the category name which displays in a stat monitor. And of course if its not that number then you use an else if for the rest of the category numbers.

Link to post
Share on other sites

I think I know what site you're talking about and if I'm right I can't tell you why it's like that since it was a long time ago but probably to save time ;)

 

You can just create a very long if then statement that says if the category number = 20 or whatever number then set a variable to be the name to be the category name which displays in a stat monitor. And of course if its not that number then you use an else if for the rest of the category numbers.

 

I thought of that after I posted and it would work but looking at some larger sites as well and I do not see that scaling all that well without confusing the hell out of me. I was hoping there was something simple that I was over looking. 

Link to post
Share on other sites

I thought of that after I posted and it would work but looking at some larger sites as well and I do not see that scaling all that well without confusing the hell out of me. I was hoping there was something simple that I was over looking. 

 

There would have to be a category name to be scraped if that doesn't exist you would have to convert it.

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...