Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. don't even bother with the cookie option. People can erase those in like half a second. Even average joe knows how to do that. IP checks aren't really that much harder to get around, either, but it's the lesser of the two evils. Ideally you should install a login/membership system and force the users to login to get to the page, and then have a counter in their account.
  2. Or just do it in a single regex.. $str = preg_replace('/[^a-z0-9\s]+/i', ' ', $str);
  3. Was there any particular part of those functions you don't understand? there are specific coding examples for showing future dates in them. For instance, look at example 3 in date
  4. Sounds like outlook ftw?
  5. NOT gonna go through this debate again.
  6. You can't have your script magically know who is logging in and out at which time if they are using the same credentials. That's the point in having separate accounts. You can shorten your timeout to require re-login to like 5 min or something but even then that's flawed because that's still 5 unaccounted minutes. IOW the correct solution would be to have unique credentials for everybody.
  7. by "basic" I mean there's really not much to it. If you google any ajax tutorial they will show you pretty much the same thing. Basically it boils down to instantiating an object, but the syntax is browser dependent.
  8. 1) what exactly do you mean by "streaming"? Do you mean like with video/audio where it plays as it downloads, or do you mean it in the "data being updated live" context? Assuming it is the latter, all you would do is setup the basic ajax functions, and then just create a function that triggers the ajax functions and also calls itself recursively using settimeout. 2) yes.
  9. well when you have delusions that you're going to one day be as big as google, sure.
  10. .josh

    text from html

    hmm...try changing it to this: // $content represents original content string $content = preg_replace('~(>)(?!\s*<).*?(<|$)~s',"$1[*CONTENT*]$2",$content); //$array represents the array of translated lines... foreach($array as $a) { $content = preg_replace('~\[\*CONTENT\*\]~',$a,$content,1); }
  11. Hey all, In short, I'm looking for a website crawler program. This is what I want out of it: - Ability to enter in a target URL as a starting point and crawl through the site, recursively grabbing links - Ability to have it open and crawl a set of links from an existing .txt file (delimiter doesn't really matter; I can make the .txt file with whatever delimiter necessary easy enough, though traditional \n would be ideal). - Ability to scrape each page crawled and return data from arbitrary regex pattern(s) I specify. Ideally, being able to specify more than one pattern and having each pattern be returned as a column would be awesome. - Ability to skip links I specify based on something it might contain (and/or conversely, only crawl links by xyz pattern). Ability to specify a pattern with straight regex would be ideal. Ability to create multiple "rules" like this even more ideal. - Ability to export results into a delimited text file (the goal being to be able to import it into excel) - It would be super awesome if this program were FREE, but I'm willing to fork over a certain amount of $$ for the right tool. I've been looking around at various programs out there, and so far this crawler called Xenu is what I have come up with, but Xenu does not offer a lot of what I'd like from a crawler. It can open and crawl text files. Do standard starting url crawling shit. But the only link filtering ability it has is letting you specify something as an internal link to be crawled if it starts with whatever (can't use regex or any regex-like function, and it has to start with it). It does have some data/info grabbing built into it, but there's no way to have it look for something specific, much less using regex. It does have ability to save as a delimited file, though. So far that's about the best free solution I've come up with. I'm fixing to start looking at what the paid solutions offer. I might have to end up creating my own solution though, judging by my research so far...creating a php solution for this is well within my abilities as a programmer to do, but I'd rather it be a standalone executable for long and boring reasons I won't really get into. So... does anybody have any experience with any programs out there that offer these things? Thoughts? Recommendations?
  12. .josh

    text from html

    // $content represents original content string $content = preg_replace('~(>)(?!\s+<).*?(<|$)~s',"$1[*CONTENT*]$2",$content); //$array represents the array of translated lines... foreach($array as $a) { $content = preg_replace('~\[\*CONTENT\*\]~',$a,$content,1); }
  13. .josh

    text from html

    hmmm I'm still kind of fuzzy on the overall picture here. I see the "before" and "after" list. I'm unclear about this whole language key/db thing, but are you saying (going of previous content example) you have this to start out with: <h3>title here</h3> <div style='width:515px;'> <img src='images/images1.jpg' id='imgr'> <p>first paragraph of text here</p> blah blahblah <p>first paragraph of text here</p> more blah <p>another one here</p> <img src='images/image2.jpg' id='imgl'>... You run the code to put it into an array, run it through the translator, so now you have an array of text in a different language, and you want to have this: <h3>**** ****</h3> <div style='width:515px;'> <img src='images/images1.jpg' id='imgr'> <p>***** ******** ** **** ****</p> *** ******* <p>***** ********** ** **** ****</p> **** **** <p>******* *** ****</p> <img src='images/image2.jpg' id='imgl'>... where the *'s are the new language text lines. Is that what you want?
  14. .josh

    text from html

    Okay so let me get this straight. Are you saying the overall goal is to strip the tags out, translate each chunk of text, and then put the tags back in? If so, can you post what you have as far as going from languageA -> languageB for these chunks of text?
  15. that will only match if there is one hex value, though. You said values so you will have to provide an example of how they are delimited. space? comma? etc...(show an actual example of content)
  16. What's the reasoning behind Kirsten Dunst? She's the lead actress in a movie called "Bring it On" - a retarded cheerleading competition movie that virtually every teenage girl on the planet obsessed over at the time.
  17. Okay just to add/clarify here, Box does not get digitized into Tron. Tron is a program Box wrote to infiltrate and destroy MCP. When Box gets digitized, him and Tron are two separate virtual entities. Also, the "past conflicts" Box had with the CEO is that they stole his game he created. That's why the programs are being forced to play "games"; it is part of the "game" world that Box created.
  18. Let's start a drinking game. Every time someone posts a link to an article trying to make some clever play on words with "Bing", everybody take a shot. Take 3 shots and wank it to Kirsten Dunst if a "Bing it on!" article is posted.
  19. yeah...just thought i remembered earlier in this thread one of the reds saying blues had ability to add them so thought i'd add it but no joy.
  20. check for javascript/ajax errors.
  21. $string = preg_replace('~<br\s?/?>([^<]*Estimated Parts:[^<]+)<br\s?/?>~is','[b]$1[/b]',$string);
  22. okay so that regex tells it to match if there is 1 letter or number at the beginning of the string, followed by one or more spaces, until end of string. ~^[a-z0-9\s]+$~i This is what you need. The regex itself will allow for spaces on the edges, but if you trim it either before or after, the rest of the regex will match what you want.
  23. You can do that, yes. Now whether it is considered bad practice or not...I don't know, as I'm not really that great at OOP either.
  24. array_keys edit: my bad, you said multi-dim. array_search go through the user notes several methods posted for that.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.