1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C# - most important things for bots

Discussion in 'C, C++, C#' started by duzkerotzki, Jan 27, 2011.

  1. duzkerotzki

    duzkerotzki Regular Member

    Joined:
    Apr 18, 2009
    Messages:
    405
    Likes Received:
    309
    Occupation:
    student
    Location:
    somewhere in europe
    Hey guys,
    i study computer science in germany.
    We learn the programming language C#.

    Well, actually we're only learning Console applications.
    I know a bit about windows forms, but i'm not the best at it.

    What are the most important things for creating bots?

    Webclient? Webbrowser? Threads?
    Gimme some hints please ;)
     
  2. agnostic

    agnostic Newbie

    Joined:
    Jul 24, 2008
    Messages:
    19
    Likes Received:
    4
    I would have to say multi threading. Everything I get programmed has to be more more then one thread and do it efficiently. A lot of programmers don't grasp it or how to do optimal. So I would say that.
     
  3. Aremys

    Aremys Regular Member

    Joined:
    Sep 13, 2008
    Messages:
    307
    Likes Received:
    72
    A lot of parsing. Regex would help.
     
  4. Autumn

    Autumn Elite Member

    Joined:
    Nov 18, 2010
    Messages:
    2,197
    Likes Received:
    3,046
    Occupation:
    I figure out ways to make money online and then au
    Location:
    Spamville
    error handling
    proxy usage, retries, proxy switching
    parsing forms
    realistic headers and browser behaviour
    logging (so you can see what's going wrong)
    unix ;-)
     
  5. duzkerotzki

    duzkerotzki Regular Member

    Joined:
    Apr 18, 2009
    Messages:
    405
    Likes Received:
    309
    Occupation:
    student
    Location:
    somewhere in europe
    aight, thanks guys.
    I already have knowledge about most of the things you told me.
    Well, i will learn it perfectly. Thanks for your help.

    When i'm good at programming there will be many bots released hehe. I just love creating something out of nothing ;p

    thanks, thread can be closed.
     
  6. Monrox

    Monrox Power Member

    Joined:
    Apr 9, 2010
    Messages:
    615
    Likes Received:
    580
    Start with a google scraper. I linked a tutorial somewhere in the General Programming Chat yesterday.

    Then redo it with httpwebrequest. Then add proxies. Then add threads.
    Optional: Then use sockets instead of the webrequest. Then learn how to use sockets with socks proxies.

    After that it's just boring tinkering to make an autoposter for some specific platform with ~10% success ratio and you realize it's cheaper and less time consuming to just outsource that part to humans, while selling the autoposter itself :)
     
    • Thanks Thanks x 1
  7. radi2k

    radi2k Junior Member

    Joined:
    Nov 29, 2009
    Messages:
    117
    Likes Received:
    34
    Location:
    Germany
    learn how to use xPath expressions and how HTTP and all the other stuff works internally. a fundamental understanding is required to create good SEO software. I'm not into C# (I'm a C++/Java guy) but i guess that simple web requests arent enough anymore. most websites (such as facebook) require that javascript is parsed and interpreted so better stick on a fully featured browser component. just make sure it doesnt leave any footprint behind such as cookies/flash data, ...

    Im ├╝brigen bin ich auch aus Deutschland!
     
    • Thanks Thanks x 1
  8. blakamia

    blakamia Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    162
    Likes Received:
    348
    HttpWebRequest and WatiN.
     
  9. Chris22

    Chris22 Regular Member

    Joined:
    Sep 29, 2010
    Messages:
    400
    Likes Received:
    1,061
    This is probably the most ridiculous thing I've ever read.
     
  10. smack

    smack Junior Member

    Joined:
    Feb 1, 2010
    Messages:
    182
    Likes Received:
    80
    Occupation:
    Software Engineer/Evil Genius
    Location:
    inside .NET
    certainly pretty damn high up on the list. :eek:

    to the OP, in no particular order:

    System.Net.Sockets
    System.Threading
    - SemaphorSlim
    - Lock
    - Mutex
    System.Text.RegularExpressions
    System.IO

    typed collections also play a large role. Queue<T>, List<T>, etc...
     
    • Thanks Thanks x 1
  11. badone34

    badone34 Newbie

    Joined:
    Feb 16, 2011
    Messages:
    46
    Likes Received:
    0
    Is there any change to use webbrowser with proxy/cookie and multithreading? Or in any other coding language? I want to execute A LOT OF js thats why I wont use curl and requests only.
     
  12. Monrox

    Monrox Power Member

    Joined:
    Apr 9, 2010
    Messages:
    615
    Likes Received:
    580
    That is possible and the easiness depends on your hardware. If you have lots or RAM you can run 10, 20 or 50 virtual machines each with an instance of your application making it 'multithreaded'.
    OR you can use a portable version of IE and run an instance of it in each thread. This also lets you automate other portable browser versions like FF, Opera and so on. But naturally it is more hassle.



    Well we can get 1000 captchas for ~$2. I gave it a thought and saw a potential. Currently I am paying $40 for 1000 manual comments and it is working great (I guess I could go lower but I prefer happy employees). The success ratio is way beyond any auto poster I've seen or created. Now 1000 may not seem like much but a lot of people forget that backlinks work best when coming from different domains.
    The day I wrote that it is better to outsource the commenting and sell the autoposter itself I was cleaning up RSS pings I monitor day and night. Out of 200 000 000 submitted urls there were approx. 800 000 unique domains, 320 000 of them were blogs.

    150 000 were open for commenting, the rest were just splogs. No more than 20 000 had a PR above 5. These blogs were hosted on at least 7 different platforms, each with all kinds of spam protection.

    Now instead of battling javascripts and trying to solve math question and what not with code, I rather spend tax deductible $800 and get a substantial amount of BLs form high PR unique domains.

    If you still think it is ridiculous, well, who am I to change your thoughts :cool:
     
    • Thanks Thanks x 1
  13. badone34

    badone34 Newbie

    Joined:
    Feb 16, 2011
    Messages:
    46
    Likes Received:
    0
    have you ever coded like this or are you onyl telling what u heard?

    cheers
     
  14. Monrox

    Monrox Power Member

    Joined:
    Apr 9, 2010
    Messages:
    615
    Likes Received:
    580
    Well I am an automation fetishist and I also prefer to use the portable version of a software, if it exists. That being said I know of no other ways to use multiple WebBrowser instances with different proxies. I also tried using axWebBrowser with no success.

    I remember an old thread offering advice on the topic, maybe you just need to tweak it a little to make it use a different proxy than the one in the IE global settings. There are newer versions of IE since 2008 afterall. See if you can make it work for you:
    http://community.livejournal.com/csharp/91915.html
     
  15. blakamia

    blakamia Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    162
    Likes Received:
    348
    Use Watin and attach Watin to WebBrowser instance. Do this as many times as you like for multithreading. You should get 20 threads at least easily this way. No need to use multiple VMs.

    If you're automating the same webpage, compile a single threaded app that does the automation. Then have a master app that creates 20 users on the windows machine, and then runs the child bot app as each of these 20 users. Since each user has different cookie cache you will be able to automate same web page with 20 different logins.

    If you want to emulate browser multithreaded and faster while executing Javascript, use Celerity with Ruby. Only way you can automate multiple browsers in C# is the way I described above.

    You coding the wrong auto posters bro.

    Paying for manual blog comment spam. lol :rolleyes:
     
    • Thanks Thanks x 3
  16. Senotaru

    Senotaru Registered Member

    Joined:
    Jan 17, 2011
    Messages:
    67
    Likes Received:
    11
    Download Fiddler and play around with some websites and learn how they work. To the people saying you need an embedded browser for Facebook: No.

    You can use httpwebrequest for basically anything on the internet and never load a single element of Javascript. As long as you're not inept as a programmer and have the ability to read what is going on, you can parse and request your way out of any situation.

    I agree with learning about headers. Without proper headers, you're not going to be sending very convincing requests, and chances are good, what ever you're botting on is going to detect you rather quickly.

    Also, I can't stress it enough, regex is going to save you. You're either going to spend a lot of time writing conditional parsers, or you're just going to quickly learn regex. It's a daunting task, but one that is, at least in my opinion, required.

    Also, in terms of success rate, I have yet to find a website that I havent been able to automate with 100% success. That sounds like your problem as a coder.

    Just my two cents.
     
    • Thanks Thanks x 1
  17. york_daro

    york_daro Registered Member

    Joined:
    Jan 12, 2010
    Messages:
    54
    Likes Received:
    3
    WatiN is too slow for me... btw, do You all have similar problem with watin where after starting mouse is going to top left part of the screen? It's annoying.

    other question... WatiN is good because of one great function : waiting untill website is 100% loaded. It's waiting for every frame to complete loading. Do You know any other way (without using WatiN) to wait for 100% webbrowser loading?
     
  18. blakamia

    blakamia Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    162
    Likes Received:
    348
    Embed Watin into webbrowser. Solves both problems. For the mouse problem you can also just save mouse coordinates before Watin init using Winapi, and then restore mouse coordinates after Watin is inited.

    Note really know. Most websites in watin I don't even wait to load, I just wait until a certain piece of the HTML is present, then I continue executing. This leads to very fast execution.

    No idea why you say Watin is slow, it's blazingly fast for me...
     
  19. Monrox

    Monrox Power Member

    Joined:
    Apr 9, 2010
    Messages:
    615
    Likes Received:
    580
    Well if you can show me an autoposter with at least 30% success rate ALL the time across a major platform I will give you a couple of thousands for it. As to 'paying', it always comes down to how much your time is worth. Farmers are also laughing at people who are paying for potatoes but how many of us are actually growing potatoes to save money? And it is not spam, a Pr5+ blog means that the post must be meaningful to get through most of the time. And by definition a meaningful post cannot be spam. Another advantage of using humans is that you can get native speakers to utilize authority blogs in other languages.

    Different users is a great tip btw, would probably test if it's faster than virtual machines.


    I never said something was impossible, I said it's not always worth it. Just like an AI is possible: take 5 billion hardware neurons, interconnect them the way the neurons in your neighbour's brain are connected and you'll have your neighbour's consciousness in a mainframe along with his emotions and experience. But the cost will be prohibitive => not woth it.

    To illustrate my point, bellow are five PR8 domains where you can drop your link. Go ahead and automate them. When you are done in a month or so, ask yourself whether it was preferable to have just outsourced it and be done with it in 5 seconds.
    Code:
    [URL]http://www.thedailybeast.com/blogs-and-stories/2011-02-26/jeremy-bernard-appointed-first-gay-male-social-secretary-/?cid=bs:featured1[/URL][URL="http://www.thedailybeast.com/blogs-and-stories/2011-02-26/jeremy-bernard-appointed-first-gay-male-social-secretary-/?cid=bs:featured1"]
    [/URL][URL]http://crooksandliars.com/susie-madrak/decision-reversed-wi-protesters-permi[/URL][URL="http://www.thedailybeast.com/blogs-and-stories/2011-02-26/jeremy-bernard-appointed-first-gay-male-social-secretary-/?cid=bs:featured1"]
    [/URL][URL]http://www.pandora.com/people/kiemainc[/URL][URL="http://www.thedailybeast.com/blogs-and-stories/2011-02-26/jeremy-bernard-appointed-first-gay-male-social-secretary-/?cid=bs:featured1"]
    [/URL][URL]http://www.politico.com/news/stories/0211/50308.html[/URL][URL="http://www.thedailybeast.com/blogs-and-stories/2011-02-26/jeremy-bernard-appointed-first-gay-male-social-secretary-/?cid=bs:featured1"]
    [/URL][URL]http://www.dailykos.com/story/2011/02/28/949750/-Where-were-you-the-day-democracy-died[/URL]
    

    Fiddler is not the optimal tool for examining traffic in automation. Both java and flash already have full sockets support and they don't need to rely on HTTP. WireShark can give a better insight sometimes.

    @york_daro check the readystate flag of the browser. It is set to true when all navigation is complete (unless the webmaster is using tricks but this is relatively rare).
     
  20. blakamia

    blakamia Junior Member

    Joined:
    Jan 25, 2010
    Messages:
    162
    Likes Received:
    348
    Copy a comment already approved on that page, and submit it again. You'd be surprised how well that works ;)

    Besides, the point of spam is quantity over quality. Filter out the high PR pages and let your VAs do them if you're such a stickler. But hit the rest with automated software.

    Finally, I have certain platforms automated so that I have 99%+ success rate (since platform is autoapprove, captcha protected. No spammers have hit it yet so webmasters don't worry about webspam). I'd sell it to you for $1000 / month, but I doubt you'd be interested haha. No matter, make way more than that with these many backlinks ;)

    -blakamia