Jump to content


  • Posts

  • Joined

  • Last visited

Semnomic's Achievements


Member (2/5)



  1. I answered my own question >> "&pid". works fine http://www.degraeve.com/reference/specialcharacters.php Im learning so was that the correct fix or is there another way to do it ?
  2. I had help on forum getting some code, i have hit a new problem when trying to insert a "&" symbol in the following line of code $rssConverted2 = preg_replace('/-([0-9]{10})/', 'pid=$1', $rssConverted1); the part "pid" above needs to be "&pid" but when i try to use &pid everything breaks. Should i be treating the "&" as some sort of special character ?
  3. Its a remote/dynamic file, it changes all the time and Im not in control of the original. Im feeding a rss to a second site as if it was my own, spoofing the orig RSS. But I need to rewrite the original urls so they fit my sites structure. "-"s where very problematic and i needed to remove them but doing so removed them from image urls and at times also the html/text/article body messing up the new rss I was outputting. I think im good now
  4. Yes thanks, never used or seen var_dump so unsure on the way it outputs Output: string(29) "cat-345xx4345645678abcd-12abc" ?? Thanks I will read up !!
  5. Hi Im struggling with this problem I have a string, in this string I have a "-" followed by 10 random digits. so eg. $mystring = cat-345-4345645678abcd-12abc I can find the "-4345645678" with ([-][0-9]{10})|. I need to replace the "-" with an "xx" the "-" I'm trying to replace MUST be followed by ten random numbers. Any ideas ?
  6. thanks i did see the last link you posted (same link) but was hoping there was some other way to do it like explode or something along those lines. I will try and work out simple xml as it is basically exploding it/doing exactly what i want.
  7. OK lets try again. I have a page on my site >> rssrewriter.php I visit this url >> mysite.com/rssrewriter.php?somerssfeed.rss I then use the code I posted to rewrite the rss and echo it out. When it rewrites the rss it changes ALL instances of my "str_replace" throughout the whole outputted rss. I want to limit the rewriting to only the url/ link - not the image,desc,etc. see below Element Description Example title The title of the item. Venice Film Festival Tries to Quit Sinking link The URL of the item. http://nytimes.com/2004/12/07FEST.html description The item synopsis. Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged. author Email address of the author of the item. More. oprah\@oxygen.net category Includes the item in one or more categories. More. comments URL of a page for comments relating to the item. More. http://www.myblog.org/cgi-local/mt/mt-comments.cgi?entry_id=290 enclosure Describes a media object that is attached to the item. More. guid A string that uniquely identifies the item. More. http://inessential.com/2002/09/01.php#a2 pubDate Indicates when the item was published. More. Sun, 19 May 2002 15:21:36 GMT source The RSS channel that the item came from. More. So i only want rewrite parts of the items in red not the whole thing.
  8. Hi - the url for the link in the feed, say it was a news rss - all items in feed have a url (link) to that article It could be called GUID not sure so dont want to confuse things. TEST LINK I need a way to make str_replace only replace parts of the url (not image url OR title etc)
  9. $rss = file_get_contents('www.somesite.com/rss'); $rssnew = str_replace('AAAA', 'BBB', $rss ); Hi got a sImple bit of code to replace text in the $rss, how do i target the url only? as it is now its replacing all instances of "AAAA" in urls,text,links,image urls,etc.
  10. I know thats where the problem is i tried '' and "" so i dont know why its not working, I can echo it so i know its there/stored but i can use it in the second part of code. What im trying to do is get that OG image to appear on my form. How would you make a small form that grabs an OG image from that url i gave and echos it out after you submit? If i can get it to echo i will be ok with the image part.
  11. <form action="form.php" method="get"> <label>Redbubble Design url: <input style height="20" width="40" type="numeric" name="url" size="35" /> </label> <p></p> <label>Design Short Desc: <input style height="20" width="40" type="numeric" name="desc" size="35"/> </label> <p></p> <label>Product Hashtags: <input style height="20" width="40" type="numeric" name="tags" size="35"/> </label> <p></p> <input type="submit"> </form> <p></p> <?php parse_str($_SERVER['QUERY_STRING']); echo $url;?> <?php $page_content = file_get_contents('$url'); $dom_obj = new DOMDocument(); $dom_obj->loadHTML($page_content); $meta_val = null; foreach($dom_obj->getElementsByTagName('meta') as $meta) { if($meta->getAttribute('property')=='og:image'){ $meta_val = $meta->getAttribute('content'); } } echo $meta_val; ?> First time posting here so i hope i got it right. im making a small program that parses OG image from a url. The above code works if I replace $url in the main php section of code with the actual url > https://www.redbubble.com/people/podartist/works/22431751-neon-orange-puffy-stitch-quilt Can anyone see what im doing wrong when i try and use the stored string $url ? $url is exactly the same as the url so im lost. Hope that makes sense. Thanks in advance
  • 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.