İptal Edildi

Make this script work in DreamHost(Doesn't allow fopen)

My host, dreamhost doesn't allow the usage of fopen, so it probably requires CURL to make this script work, please make it work in dreamhost!

<?php

set_time_limit(0);

$file = "[url removed, login to view];ned=us&ie=UTF-8&q=blue+shoes&output=rss";

$rss_channel = array();

$currently_writing = "";

$main = "";

$item_counter = 0;

function startElement($parser, $name, $attrs) {

global $rss_channel, $currently_writing, $main;

switch($name) {

case "RSS":

case "RDF:RDF":

case "ITEMS":

$currently_writing = "";

break;

case "CHANNEL":

$main = "CHANNEL";

break;

case "IMAGE":

$main = "IMAGE";

$rss_channel["IMAGE"] = array();

break;

case "ITEM":

$main = "ITEMS";

break;

default:

$currently_writing = $name;

break;

}

}

function endElement($parser, $name) {

global $rss_channel, $currently_writing, $item_counter;

$currently_writing = "";

if ($name == "ITEM") {

$item_counter++;

}

}

function characterData($parser, $data) {

global $rss_channel, $currently_writing, $main, $item_counter;

if ($currently_writing != "") {

switch($main) {

case "CHANNEL":

if (isset($rss_channel[$currently_writing])) {

$rss_channel[$currently_writing] .= $data;

} else {

$rss_channel[$currently_writing] = $data;

}

break;

case "IMAGE":

if (isset($rss_channel[$main][$currently_writing])) {

$rss_channel[$main][$currently_writing] .= $data;

} else {

$rss_channel[$main][$currently_writing] = $data;

}

break;

case "ITEMS":

if (isset($rss_channel[$main][$item_counter][$currently_writing])) {

$rss_channel[$main][$item_counter][$currently_writing] .= $data;

} else {

$rss_channel[$main][$item_counter][$currently_writing] = $data;

}

break;

}

}

}

$xml_parser = xml_parser_create();

xml_set_element_handler($xml_parser, "startElement", "endElement");

xml_set_character_data_handler($xml_parser, "characterData");

if (!($fp = fopen($file, "r"))) {

die("could not open XML input");

}

while ($data = fread($fp, 4096)) {

if (!xml_parse($xml_parser, $data, feof($fp))) {

die(sprintf("XML error: %s at line %d",

xml_error_string(xml_get_error_code($xml_parser)),

xml_get_current_line_number($xml_parser)));

}

}

xml_parser_free($xml_parser);

// output HTML

//print ("" . $rss_channel["TITLE"] . "");

if (isset($rss_channel["ITEMS"])) {

if (count($rss_channel["ITEMS"]) > 0) {

// for($i = 0;$i < count($rss_channel["ITEMS"]);$i++) {

for($i = 0;$i < 5;$i++) {

if (isset($rss_channel["ITEMS"][$i]["LINK"])) {

//print ("n" . $rss_channel["ITEMS"][$i]["TITLE"] . "");

} else {

print ("n" . $rss_channel["ITEMS"][$i]["TITLE"] . "");

}

print ("" . $rss_channel["ITEMS"][$i]["DESCRIPTION"] . ""); }

} else {

print ("There are no new articles.");

}

}

?>

This might help:
http://wiki.dreamhost.com/index.php/CURL
http://wiki.dreamhost.com/index.php/Allow_url_fopen

budget is $25 max

Beceriler: PHP

Daha fazlasını görün: work com, work c, new line in php, make line, make $5, com work, break com, at & t, at &t, script dreamhost, dreamhost fopen, work.com, work in google, blue host, xml script, xml php array, Work, work in, t , t-, t, t s, rdf, news-r, make

İşveren Hakkında:
( 7 değerlendirme ) Fountain Valley, United States

Proje NO: #68861

7 freelancer bu iş için ortalamada 62$ teklif veriyor

XaprioSolutions

Simple job.. would like to do it for you... Regards Xaprio Solutions ... [url removed, login to view]

1 gün içinde 50$ USD
(56 Değerlendirme)
6.2
dynamicwebsol

Can make this script work. Can I do it now ?

in 0 gün içinde50$ USD
(6 Değerlendirme)
3.8
varshyltech

We at Varshyl Tech - an ITES helps businesses in their software, database design, website development and other related vertical needs with primary focus on Website Design and Development, Application Development, Cust Daha fazlası

in 5 gün içinde100$ USD
(2 Değerlendirme)
3.3
justinatmizzou

Please check pm. Thanks, Justin

1 gün içinde 100$ USD
(1 Değerlendirme)
1.7
kodo

i can do it.

in 0 gün içinde30$ USD
(0 Değerlendirme)
0.0
IntSS

GOOD QUALITY WORK WITH INTIME DELIVERY OF THE PRODUCT . 100% GUARANTEED OF HIGH QUALITY PROFESSIONAL WORK, AS WE ARE THE EXPERTISE IN JAVA/J2EE , JSP , EJB, ASP,PHP, STRUTS FRAME WORK RELATED PROJECTS. OUR COMPANY HAS Daha fazlası

in 5 gün içinde75$ USD
(0 Değerlendirme)
0.0
lraek

I have used CURL to Login to restricted sites compare data and post the difference back to the site. No problem at all to fix.

1 gün içinde 30$ USD
(0 Değerlendirme)
0.0