GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Coders - Help before I throw another laptop out of the widow.... (https://gfy.com/showthread.php?t=1058584)

EddyTheDog 02-22-2012 08:20 AM

Coders - Help before I throw another laptop out of the widow....
 
I am trying to send a REST url like this - It looks odd as its for YQL..

Code:

http://query.yahooapis.com/v1/public/yql?q=insert into wordpress.post (title, description, blogurl, username, password) values ("Test damian", "<a href="http//:www.xxx.net">Damian</a>", "http://xxxxxxx.co.uk", "kjhjkhjkh", "kjhkjhjkhj")&format=json&diagnostics=true&env=store://datatables.org/alltableswithkeys&callback=cbfunc
Its obviously sent encoded - The above is for clarity

Code:

http://query.yahooapis.com/v1/public/yql?q=insert%20into%20wordpress.post%20(title%2C%20description%2C%20blogurl%2C%20username%2C%20password)%20values%20(%22Test%20damian%22%2C%20%22%3Ca%20href%3D%22http%2F%2F%3Awww.xxx.net%22%3EDamian%3C%2Fa%3E%22%2C%20%22http%3A%2F%2Fxxxxxxx.co.uk%22%2C%20%22kjhjkhjkh%22%2C%20%22kjhkjhjkhj%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc
I can see what the problem is - I have highlighted the little fuckers in red in the code - I have tried escaping them and that works but then the backslash appears in the HTML for the post and that is obviously no good.....

This all new to me and I just can not see a way around it - the documentation is sparse at best...

Any ideas?

:Oh crap

EddyTheDog 02-22-2012 09:05 AM

Worked it out.......

2 Hours of my life I will never get back.

lucas131 02-22-2012 09:09 AM

ok then ... :)

V_RocKs 02-22-2012 10:15 AM

Tee hee!

Fletch XXX 02-22-2012 10:18 AM

Quote:

Originally Posted by EddyTheDog (Post 18774704)
Worked it out.......

2 Hours of my life I will never get back.

ive found though, when something like this gets in your way you end up learning something and it will never happen again.

Fap 02-22-2012 10:44 AM

What'd you learrrn?

Why 02-22-2012 10:56 AM

dont put double quotes inside your double quotes. ;)

EddyTheDog 02-22-2012 11:07 AM

Quote:

Originally Posted by Why (Post 18774944)
dont put double quotes inside your double quotes. ;)

I knew that - I couldn't work out how to use html without double quotes or escaping them....

It turns out that you can use single quotes on the outside in the YQL and then you can escape the single quotes in the html itself.

It is true I did learn a lot fucking around with that stuff all afternoon....

mikke 02-22-2012 11:16 AM

Quote:

query.yahooapis.com/v1/public/yql?q=insert into wordpress.post (title, description, blogurl, username, password) values ('Test damian', '<a href="http//:www.xxx.net">Damian</a>', 'http://xxxxxxx.co.uk', 'kjhjkhjkh', 'kjhkjhjkhj')&format=json&diagnostics=true&env=sto re://datatables.org/alltableswithkeys&callback=cbfunc
returned
Quote:

cbfunc({"query":{"count":0,"created":"2012-02-22T18:15:59Z","lang":"en-US","diagnostics":{"publiclyCallable":"true","url" :[{"execution-start-time":"19","execution-stop-time":"420","execution-time":"401","proxy":"DEFAULT","content":"http://www.datatables.org/wordpress/wordpress.post.xml"},{"execution-start-time":"431","execution-stop-time":"492","execution-time":"61","proxy":"DEFAULT","content":"http://xxxxxxx.co.uk/xmlrpc.php"}],"javascript":["Exception: TypeError: Cannot read property \"param\" from undefined (<javascript>#163)",{"execution-time":"67","instructions-used":"42067","table-name":"wordpress.post"}],"user-time":"493","service-time":"462","build-version":"25358"},"results":null}});
looks like it's working?

EddyTheDog 02-22-2012 11:23 AM

Quote:

Originally Posted by mikke (Post 18774986)
returned


looks like it's working?

Yeah - No problems now I am using the single quotes...

Just have to make sure any single quotes in the html are escaped... :thumbsup

martinsc 02-22-2012 11:25 AM

it's funny how a little thing can keep you busy and cursing for hours....

redwhiteandblue 02-22-2012 11:41 AM

Quote:

Originally Posted by Fletch XXX (Post 18774846)
ive found though, when something like this gets in your way you end up learning something and it will never happen again.

Until you run it on another server and it fucks up all over again in a different way.

EddyTheDog 02-22-2012 11:44 AM

Quote:

Originally Posted by redwhiteandblue (Post 18775047)
Until you run it on another server and it fucks up all over again in a different way.

lol - I am running this on a local machine and will have to migrate it - I am not looking forward to that!!

FlexxAeon 02-22-2012 11:46 AM

Quote:

Originally Posted by martinsc (Post 18775007)
it's funny how a little thing can keep you busy and cursing for hours....

:2 cents:

my little mantra is "99% of the time it's something small and stupid!'


All times are GMT -7. The time now is 02:52 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123