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

Make articles unique with php/html/css/ trick

Discussion in 'PHP & Perl' started by fimms, Sep 3, 2011.

  1. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    I just had some spare time and came with this small function to get old articles passing from CopyScape. This doesn't mean they will be ok for search engines and example makes only one unique version of the article. Anyway someone may see this interesting and give other ideas for content optimizing.

    PHP:

    <?php

    /**
     * Make your old articles unique with html css trick
     * 
     * Example article copied from: peterhutch.articlesbase.com/skin-care-articles/large-pores-treatment-367558.html
     * Copyscape finds a lot of duplicates: copyscape.com/?q=http%3A%2F%2Fpeterhutch.articlesbase.com%2Fskin-care-articles%2Flarge-pores-treatment-367558.html
     * After uniquefy article was submitted to blogspot: homeremediesforlargepores.blogspot.com/2011/09/home-remedies-for-large-pores.html
     * Copyscape cant find replications: copyscape.com/?q=http%3A%2F%2Fhomeremediesforlargepores.blogspot.com%2F2011%2F09%2Fhome-remedies-for-large-pores.html
     * Bulkpinged for indexing purposes: bulkping.com
     * Will see if article gets indexed and ranks any on Google, Bing and Yahoo.
     */

    # choose stop word wrapper tag. can be anything from html specificated to your own
    $tag 'c';

    # choose attribute to use on css. can be anything from html specificated to your own
    $attribute 'd';

    # sample text
    $text '<p>Large pores are simply a genetic problem. Large pores are often an indication of oily skin. Large pores (sometimes referred to as enlarged pores) are likewise more common in the T-zone and occur most often on those with oily skin. Though not always, large pores and blackheads tend to go hand in hand. Blackheads and large pores usually come together. This is because the pores are larger, so oil and dead skin sits inside of them. This becomes a blackhead and stretches the pore even larger.
    </p><p>If enlarged pores are due to blackheads stretching the entrance of the pore, then firstly remove blackheads using one of the above methods, then to contract pores, blend (one or your preferred mixture) of camphor, sage and / or thyme in a base of jojoba oil. Use as a compress or mix in with your moisturiser and apply to affected areas. Jojoba is easily absorbed into the skin and balances oil levels (which may assist in reducing blackheads as sebum production is regulated).
    </p><p>Oatmeal and gram flour are good toning substance. You can add a little lemon juice, rose water and curd to them and apply on the skin. Wash this pack off when it dries. It tones the pores and enhances the complexion.
    </p><p>Honey is equally good to tone up the pores and reduce the oiliness from the skin. It can be applied in any of the facemask or can be directly applied on the skin with a little lemon juice and sugar to it. You can massage it on face and leave it for few minutes. Then rinse it off with lukewarm water. Honey added to milk powder too helps if applied on the skin. A paste made of salt and butter is helpful in reducing pore size if applied on them.
    </p><p>Add tomato juice to calamine powder or sandalwood powder, as they help in reducing the size of the pores and even tone up the skin well. These packs help skin to reduce the sebum production and thus help in reducing the size of the pores.
    </p><p>Boire strips help with blackhead removal, so if you have blackheads, use them. They are effective. Also, scrub your face regularly to prevent your pores from getting clogged. Make sure you use a scrub that suits you, because certain scrubs can cause a rash.
    </p><p>Egg skin is a pore-shrinker that also helps bring skin eruptions to a head. Break an egg, reserve its contents for other use, and then carefully remove the membrane from the inside of the shell. Smooth this egg skin over the enlarged pores; let dry before peeling off.
    </p><p>Sunburn is better prevented than treated. Effective sunscreens are available in a wide variety of strengths. Most doctors recommend a sunscreen SPF level of 30 or greater.
    </p><p>Large pores are simply a genetic problem, but you can temporarily reduce large pores by clearing away dirt and debris. Large pores are often an indication of oily skin. Use one after the other for cleansing and exfoliating the skin. Mix 2 egg whites with a few drops of lemon juice. Apply on face and leave on for 5-7 minutes, then rinse with hands. As egg whites dry, they lighten the skin and pull debris out of pores.
    </p><p>Mix almond meal with enough water to make a paste. Apply to pores for 20 minutes. Rinse with warm water, and then apply witch hazel or a solution of apple cider vinegar and water.</p>'
    ;

    # stop words grapped from wp slug function
    $words = array ("a""able""about""above""abroad""according""accordingly""across""actually""adj""after""afterwards""again""against""ago""ahead""ain't""all""allow""allows""almost""alone""along""alongside""already""also""although""always""am""amid""amidst""among""amongst""an""and""another""any""anybody""anyhow""anyone""anything""anyway""anyways""anywhere""apart""appear""appreciate""appropriate""are""aren't""around""as""a's""aside""ask""asking""associated""at""available""away""awfully""b""back""backward""backwards""be""became""because""become""becomes""becoming""been""before""beforehand""begin""behind""being""believe""below""beside""besides""best""better""between""beyond""both""brief""but""by""c""came""can""cannot""cant""can't""caption""cause""causes""certain""certainly""changes""clearly""c'mon""co""co.""com""come""comes""concerning""consequently""consider""considering""contain""containing""contains""corresponding""could""couldn't""course""c's""currently""d""dare""daren't""definitely""described""despite""did""didn't""different""directly""do""does""doesn't""doing""done""don't""down""downwards""during""e""each""edu""eg""eight""eighty""either""else""elsewhere""end""ending""enough""entirely""especially""et""etc""even""ever""evermore""every""everybody""everyone""everything""everywhere""ex""exactly""example""except""f""fairly""far""farther""few""fewer""fifth""first""five""followed""following""follows""for""forever""former""formerly""forth""forward""found""four""from""further""furthermore""g""get""gets""getting""given""gives""go""goes""going""gone""got""gotten""greetings""h""had""hadn't""half""happens""hardly""has""hasn't""have""haven't""having""he""he'd""he'll""hello""help""hence""her""here""hereafter""hereby""herein""here's""hereupon""hers""herself""he's""hi""him""himself""his""hither""hopefully""how""howbeit""however""hundred""i""i'd""ie""if""ignored""i'll""i'm""immediate""in""inasmuch""inc""inc.""indeed""indicate""indicated""indicates""inner""inside""insofar""instead""into""inward""is""isn't""it""it'd""it'll""its""it's""itself""i've""j""just""k""keep""keeps""kept""know""known""knows""l""last""lately""later""latter""latterly""least""less""lest""let""let's""like""liked""likely""likewise""little""look""looking""looks""low""lower""ltd""m""made""mainly""make""makes""many""may""maybe""mayn't""me""mean""meantime""meanwhile""merely""might""mightn't""mine""minus""miss""more""moreover""most""mostly""mr""mrs""much""must""mustn't""my""myself""n""name""namely""nd""near""nearly""necessary""need""needn't""needs""neither""never""neverf""neverless""nevertheless""new""next""nine""ninety""no""nobody""non""none""nonetheless""noone""no-one""nor""normally""not""nothing""notwithstanding""novel""now""nowhere""o""obviously""of""off""often""oh""ok""okay""old""on""once""one""ones""one's""only""onto""opposite""or""other""others""otherwise""ought""oughtn't""our""ours""ourselves""out""outside""over""overall""own""p""particular""particularly""past""per""perhaps""placed""please""plus""possible""presumably""probably""provided""provides""q""que""quite""qv""r""rather""rd""re""really""reasonably""recent""recently""regarding""regardless""regards""relatively""respectively""right""round""s""said""same""saw""say""saying""says""second""secondly""see""seeing""seem""seemed""seeming""seems""seen""self""selves""sensible""sent""serious""seriously""seven""several""shall""shan't""she""she'd""she'll""she's""should""shouldn't""since""six""so""some""somebody""someday""somehow""someone""something""sometime""sometimes""somewhat""somewhere""soon""sorry""specified""specify""specifying""still""sub""such""sup""sure""t""take""taken""taking""tell""tends""th""than""thank""thanks""thanx""that""that'll""thats""that's""that've""the""their""theirs""them""themselves""then""thence""there""thereafter""thereby""there'd""therefore""therein""there'll""there're""theres""there's""thereupon""there've""these""they""they'd""they'll""they're""they've""thing""things""think""third""thirty""this""thorough""thoroughly""those""though""three""through""throughout""thru""thus""till""to""together""too""took""toward""towards""tried""tries""truly""try""trying""t's""twice""two""u""un""under""underneath""undoing""unfortunately""unless""unlike""unlikely""until""unto""up""upon""upwards""us""use""used""useful""uses""using""usually""v""value""various""versus""very""via""viz""vs""w""want""wants""was""wasn't""way""we""we'd""welcome""well""we'll""went""were""we're""weren't""we've""what""whatever""what'll""what's""what've""when""whence""whenever""where""whereafter""whereas""whereby""wherein""where's""whereupon""wherever""whether""which""whichever""while""whilst""whither""who""who'd""whoever""whole""who'll""whom""whomever""who's""whose""why""will""willing""wish""with""within""without""wonder""won't""would""wouldn't""x""y""yes""yet""you""you'd""you'll""your""you're""yours""yourself""yourselves""you've""z""zero");

    # print uniquefied text with style definition prefix
    echo "<style>{$tag}:before {content: ' ' attr({$attribute})}</style>".uniquefy($text$words$tag$attribute);

    # remove all stop words and replace with wrapped tag which attribute value will be the stop word
    # so stop words are removed from the text as per search engines but user will see text as normal
    function uniquefy($text$words$tag$attribute) {
        while (
    $word array_pop($words)) {
            if (
    stripos($text' '.$word.' ') !== FALSE) {
                
    $text str_replace(' '.$word.' '"<$tag $attribute=\"$word\"> "$text);
            }
        }
        return 
    $text
    }

    ?>

     
    • Thanks Thanks x 1
  2. Hierarchy

    Hierarchy Regular Member

    Joined:
    Dec 13, 2007
    Messages:
    237
    Likes Received:
    213
    Great php work. I dig it.. Perfect for some beginners to learn from.
     
    • Thanks Thanks x 1
  3. dgthiyagu

    dgthiyagu Regular Member

    Joined:
    Mar 23, 2011
    Messages:
    266
    Likes Received:
    141
    how to use this php code and uniquefy the article ...?

    :confused:

     
  4. machines-in-motion

    machines-in-motion Junior Member

    Joined:
    Aug 11, 2010
    Messages:
    129
    Likes Received:
    46
    Occupation:
    Engineer
    Location:
    Here and there
    No offense, but I don't think that will do much. The duplicate content filter should find you if you are only switching up the HTML. I would modify that with a 2D array of "strict" synonyms and stick code to swap them around into your unequefy(...) method. I could be wrong, of course, but that seems like something G would check for.
     
  5. timothywcrane

    timothywcrane Power Member

    Joined:
    Apr 25, 2009
    Messages:
    590
    Likes Received:
    236
    Occupation:
    Internet Promotion Management
    Location:
    USA
    Home Page:

    "This doesn't mean they will be ok for search engines" i THINK HE MADE THAT POINT. Thanks for the code. Any licensing?
     
  6. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    There are four variables to change, but I would just put your article text, plain or html to the $text variable and run script on local server with php module installed via browser.

    Modified text is printed, take html code view, copy and use it...
     
    • Thanks Thanks x 1
  7. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    Yeah, I don't know exactly how filter works from Googles side, thats why I put text on blogger and will see in few days. My concern is that there arent really stop words on text now. How bots are taking that, I have no idea!
     
  8. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    Np. Use and modify by your own risk -license :)
     
  9. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    Site and page got indexed pretty easily:

    HTML:
    google.com/search?q=site:http%3A%2F%2Fhomeremediesforlargepores.blogspot.com
    Three other pages I posted with same method showed 3% & 8% & 10% matching according to CopyScape. Reordering phrases and using synonyms could help on those cases.

    I'm tracking few pages and long tail keywords next. I will update progress in couple of weeks.
     
    Last edited: Sep 4, 2011
  10. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    I didn't find a way to edit my original post, so I'm putting this new code as a new post. It includes optional ie fix with javascript hack. Ie doesn't support pseudo elements, so it causes awful text for reader because all stop words are removed. This ends up my experiment with the case unless rankings show indication its worth of further investigation.

    PHP:
    <?php

    /**
     * Make your old articles unique with html css (javascript) trick
     * 
     * Example article copied from: http://peterhutch.articlesbase.com/skin-care-articles/large-pores-treatment-367558.html
     * Copyscape finds a lot of duplicates: http://copyscape.com/?q=http%3A%2F%2Fpeterhutch.articlesbase.com%2Fskin-care-articles%2Flarge-pores-treatment-367558.html
     * After uniquefy article was submitted to blogspot: http://homeremediesforlargepores.blogspot.com/2011/09/home-remedies-for-large-pores.html
     * Copyscape cant find replications: http://copyscape.com/?q=http%3A%2F%2Fhomeremediesforlargepores.blogspot.com%2F2011%2F09%2Fhome-remedies-for-large-pores.html
     * Bulkpinged for indexing purposes: http://www.bulkping.com/
     * Will see if article gets indexed and ranks any on Google, Bing and Yahoo.
     */

    # choose stop word wrapper tag. can be anything from html specificated to your own (except ie doesnt work well with custom html tags)
    $tag 'span';

    # choose attribute to use on css. can be anything from html specificated to your own
    $attribute 'd';

    # we dont want to affect other html code on same page but wrapped with this div only
    $text_wrapper_id 'utext';

    # ie doesnt support pseudo elements, so there is a javascript hack included now
    # see everything goes complicated, when everything needs to be cared ;)
    $iefix TRUE;

    # sample text
    $text '<p>Large pores are simply a genetic problem. Large pores are often an indication of oily skin. Large pores (sometimes referred to as enlarged pores) are likewise more common in the T-zone and occur most often on those with oily skin. Though not always, large pores and blackheads tend to go hand in hand. Blackheads and large pores usually come together. This is because the pores are larger, so oil and dead skin sits inside of them. This becomes a blackhead and stretches the pore even larger.
    </p><p>If enlarged pores are due to blackheads stretching the entrance of the pore, then firstly remove blackheads using one of the above methods, then to contract pores, blend (one or your preferred mixture) of camphor, sage and / or thyme in a base of jojoba oil. Use as a compress or mix in with your moisturiser and apply to affected areas. Jojoba is easily absorbed into the skin and balances oil levels (which may assist in reducing blackheads as sebum production is regulated).
    </p><p>Oatmeal and gram flour are good toning substance. You can add a little lemon juice, rose water and curd to them and apply on the skin. Wash this pack off when it dries. It tones the pores and enhances the complexion.
    </p><p>Honey is equally good to tone up the pores and reduce the oiliness from the skin. It can be applied in any of the facemask or can be directly applied on the skin with a little lemon juice and sugar to it. You can massage it on face and leave it for few minutes. Then rinse it off with lukewarm water. Honey added to milk powder too helps if applied on the skin. A paste made of salt and butter is helpful in reducing pore size if applied on them.
    </p><p>Add tomato juice to calamine powder or sandalwood powder, as they help in reducing the size of the pores and even tone up the skin well. These packs help skin to reduce the sebum production and thus help in reducing the size of the pores.
    </p><p>Boire strips help with blackhead removal, so if you have blackheads, use them. They are effective. Also, scrub your face regularly to prevent your pores from getting clogged. Make sure you use a scrub that suits you, because certain scrubs can cause a rash.
    </p><p>Egg skin is a pore-shrinker that also helps bring skin eruptions to a head. Break an egg, reserve its contents for other use, and then carefully remove the membrane from the inside of the shell. Smooth this egg skin over the enlarged pores; let dry before peeling off.
    </p><p>Sunburn is better prevented than treated. Effective sunscreens are available in a wide variety of strengths. Most doctors recommend a sunscreen SPF level of 30 or greater.
    </p><p>Large pores are simply a genetic problem, but you can temporarily reduce large pores by clearing away dirt and debris. Large pores are often an indication of oily skin. Use one after the other for cleansing and exfoliating the skin. Mix 2 egg whites with a few drops of lemon juice. Apply on face and leave on for 5-7 minutes, then rinse with hands. As egg whites dry, they lighten the skin and pull debris out of pores.
    </p><p>Mix almond meal with enough water to make a paste. Apply to pores for 20 minutes. Rinse with warm water, and then apply witch hazel or a solution of apple cider vinegar and water.</p>'
    ;

    # stop words grabbed from wp slug function
    $words = array ("a""able""about""above""abroad""according""accordingly""across""actually""adj""after""afterwards""again""against""ago""ahead""ain't""all""allow""allows""almost""alone""along""alongside""already""also""although""always""am""amid""amidst""among""amongst""an""and""another""any""anybody""anyhow""anyone""anything""anyway""anyways""anywhere""apart""appear""appreciate""appropriate""are""aren't""around""as""a's""aside""ask""asking""associated""at""available""away""awfully""b""back""backward""backwards""be""became""because""become""becomes""becoming""been""before""beforehand""begin""behind""being""believe""below""beside""besides""best""better""between""beyond""both""brief""but""by""c""came""can""cannot""cant""can't""caption""cause""causes""certain""certainly""changes""clearly""c'mon""co""co.""com""come""comes""concerning""consequently""consider""considering""contain""containing""contains""corresponding""could""couldn't""course""c's""currently""d""dare""daren't""definitely""described""despite""did""didn't""different""directly""do""does""doesn't""doing""done""don't""down""downwards""during""e""each""edu""eg""eight""eighty""either""else""elsewhere""end""ending""enough""entirely""especially""et""etc""even""ever""evermore""every""everybody""everyone""everything""everywhere""ex""exactly""example""except""f""fairly""far""farther""few""fewer""fifth""first""five""followed""following""follows""for""forever""former""formerly""forth""forward""found""four""from""further""furthermore""g""get""gets""getting""given""gives""go""goes""going""gone""got""gotten""greetings""h""had""hadn't""half""happens""hardly""has""hasn't""have""haven't""having""he""he'd""he'll""hello""help""hence""her""here""hereafter""hereby""herein""here's""hereupon""hers""herself""he's""hi""him""himself""his""hither""hopefully""how""howbeit""however""hundred""i""i'd""ie""if""ignored""i'll""i'm""immediate""in""inasmuch""inc""inc.""indeed""indicate""indicated""indicates""inner""inside""insofar""instead""into""inward""is""isn't""it""it'd""it'll""its""it's""itself""i've""j""just""k""keep""keeps""kept""know""known""knows""l""last""lately""later""latter""latterly""least""less""lest""let""let's""like""liked""likely""likewise""little""look""looking""looks""low""lower""ltd""m""made""mainly""make""makes""many""may""maybe""mayn't""me""mean""meantime""meanwhile""merely""might""mightn't""mine""minus""miss""more""moreover""most""mostly""mr""mrs""much""must""mustn't""my""myself""n""name""namely""nd""near""nearly""necessary""need""needn't""needs""neither""never""neverf""neverless""nevertheless""new""next""nine""ninety""no""nobody""non""none""nonetheless""noone""no-one""nor""normally""not""nothing""notwithstanding""novel""now""nowhere""o""obviously""of""off""often""oh""ok""okay""old""on""once""one""ones""one's""only""onto""opposite""or""other""others""otherwise""ought""oughtn't""our""ours""ourselves""out""outside""over""overall""own""p""particular""particularly""past""per""perhaps""placed""please""plus""possible""presumably""probably""provided""provides""q""que""quite""qv""r""rather""rd""re""really""reasonably""recent""recently""regarding""regardless""regards""relatively""respectively""right""round""s""said""same""saw""say""saying""says""second""secondly""see""seeing""seem""seemed""seeming""seems""seen""self""selves""sensible""sent""serious""seriously""seven""several""shall""shan't""she""she'd""she'll""she's""should""shouldn't""since""six""so""some""somebody""someday""somehow""someone""something""sometime""sometimes""somewhat""somewhere""soon""sorry""specified""specify""specifying""still""sub""such""sup""sure""t""take""taken""taking""tell""tends""th""than""thank""thanks""thanx""that""that'll""thats""that's""that've""the""their""theirs""them""themselves""then""thence""there""thereafter""thereby""there'd""therefore""therein""there'll""there're""theres""there's""thereupon""there've""these""they""they'd""they'll""they're""they've""thing""things""think""third""thirty""this""thorough""thoroughly""those""though""three""through""throughout""thru""thus""till""to""together""too""took""toward""towards""tried""tries""truly""try""trying""t's""twice""two""u""un""under""underneath""undoing""unfortunately""unless""unlike""unlikely""until""unto""up""upon""upwards""us""use""used""useful""uses""using""usually""v""value""various""versus""very""via""viz""vs""w""want""wants""was""wasn't""way""we""we'd""welcome""well""we'll""went""were""we're""weren't""we've""what""whatever""what'll""what's""what've""when""whence""whenever""where""whereafter""whereas""whereby""wherein""where's""whereupon""wherever""whether""which""whichever""while""whilst""whither""who""who'd""whoever""whole""who'll""whom""whomever""who's""whose""why""will""willing""wish""with""within""without""wonder""won't""would""wouldn't""x""y""yes""yet""you""you'd""you'll""your""you're""yours""yourself""yourselves""you've""z""zero");

    # print uniquefied text with style definition prefix. ie and opera needs special fix made with javascript for pseudo :before style definition
    echo "<style>#$text_wrapper_id {$tag}:before {content: ' ' attr({$attribute})}</style>".uniquefy('<div id="'.$text_wrapper_id.'">'.$text.'</div>'$words$tag$attribute).($iefix?"<script>if((navigator.appVersion.indexOf('MSIE')!=-1&&navigator.appVersion.indexOf('Opera')==-1)){var t=document.getElementById('$text_wrapper_id').getElementsByTagName('$tag');for(var i=0;i<t.length;++i)t[i].innerHTML=' '+t[i].$attribute}</script>":'');

    # remove all stop words and replace with wrapped tag which attribute value will be the stop word
    # stop words are removed from the text as per search engines but user will see text as normal
    function uniquefy($text$words$tag$attribute) {
        while (
    $word array_pop($words)) {
            if (
    stripos($text' '.$word.' ') !== FALSE) {
                
    $text str_replace(' '.$word.' '"<$tag $attribute=\"$word\"></$tag> "$text);
            }
        }
        return 
    $text
    }

    ?>
     
    • Thanks Thanks x 1
  11. xenon2010

    xenon2010 Regular Member

    Joined:
    Apr 27, 2010
    Messages:
    231
    Likes Received:
    48
    Occupation:
    web and desktop apps programmer
    Location:
    prison
    Home Page:
    you might also want to send it to googletranslate to translate it to french.. then translate it back to english.. you will get more unique words..
     
  12. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    I've been doing that, but adding one more translation like: en-it-fr-en. Its nice approach also for random text because it trims output from noise. I could provide php script for that. Im just afraid, how long Google is going to provide that service via api and for free...

    Btw. all 5 articles got indexed on Google yesterday. But I can't see them ranking yet...
     
  13. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    Just small update... about ten long tail keywords are ranking between 600-1000 yesterday :eek:
     
  14. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    Today I got three keywords ranking between 30 and 20 on Google for blogspot made with stop word modifications. Pretty good experiment I think.