[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Using Net::HTTP to prod google adwords api

chrisjroos@gmail.com

9/13/2006 11:47:00 AM

Hi,

I've been trying to use Net::HTTP with a SOAP (xml) document to query
google adwords api. The reason for wanting to do this, is that I've
stumbled across a problem with one of the methods when using
adwords4r. I wanted to eliminate adwords4r and soap4r from the
equation, hence trying to manipulate manually.

I've copied the http headers from the output I see when using
adwords4r (code is at bottom of message). Unfortunately, I get a http
302 response rather than the expected xml document.

I'm wondering if there's anything obvious I'm missing?

Chris

-- code --

xml = %%
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSc...
xmlns:env="http://schemas.xmlsoap.org/soap/envel...
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance...
<env:Header>
<token env:mustUnderstand="0">MYEMAIL++GBP</token>
<useragent env:mustUnderstand="0">ruby api</useragent>
<password env:mustUnderstand="0">MYPASSWORD</password>
<clientEmail env:mustUnderstand="0">client_1+MYEMAIL</clientEmail>
<email env:mustUnderstand="0">MYEMAIL</email>
</env:Header>
<env:Body>
<getUsageQuotaThisMonth xmlns="https://adwords.google.com/api/adwords/v5...
</getUsageQuotaThisMonth>
</env:Body>
</env:Envelope>
%

require 'net/https'
require 'uri'

url = URI.parse('https://sandbox.google.com/api/adwords/v5/InfoSe...)
http = Net::HTTP.new(url.host)
http.set_debug_output(STDERR)

request = Net::HTTP::Post.new(url.path)
request['Content-Type'] = "text/xml; charset=utf-8"
request['User-Agent'] = "Ruby client"
request['Soapaction'] = "\"\""
request.body = xml
http.start do |sess|
sess.request(request)
end

1 Answer

Chet

11/23/2008 9:20:00 PM

0

On Nov 22, 7:24 am, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> wrote:
> Can you clarify something for me? What exactly do you mean when you say "if
> the cell is linked to another part of the workbook"?
>
> --
> Rick (MVP - Excel)
>
> "Chet" <chetshan...@gmail.com> wrote in message
>
> news:1e119fb5-e11b-4c81-99dd-a050eb36c6ee@r37g2000prr.googlegroups.com...
> On Nov 21, 5:54 pm, JLGWhiz <JLGW...@discussions.microsoft.com> wrote:
>
>
>
>
>
> > Sub ColorSpecialCellsFont()
> > 'The If statement avoids error message
> > Set myRange = Sheets(1).Range("b2:b6")
> > If Not myRange.SpecialCells(xlCellTypeFormulas).Count < 1 Then
> > myRange.SpecialCells(xlCellTypeFormulas).Font.ColorIndex = 3
> > End If
> > End Sub
>
> > "Chet" wrote:
> > > I can write vba code but this has me stumped. Does anyone have an
> > > idea how to format cell text color by the property of the type of cell
> > > it is?
>
> > > For example if the cell is a constant the font would be red, if the
> > > cell has a formula in it then it would be blue, and if the cell is
> > > linked to another part of the workbook then it would be green.
>
> > > I would be greatful for any ideas.
>
> > > Thanks,
>
> > > Chet- Hide quoted text -
>
> > - Show quoted text -
>
> I kind of understand you are doing this, but how would i detect cells
> where that particular cell is linked to another cell?- Hide quoted text -
>
> - Show quoted text -

I wasn't very clear and I gave it some more thought. I'm trying to
show cells in three different ways.

1. A constant just entered as a number
2. A direct link where a cell has contents something like =A5 or
=Sheet2!B8
3. Any other type of formula such as =vlookup(a4,b4:b9,2,0). I
realize that this item is probably a subset of #2 but I am trying to
change the font color on something like this and make it different
than #2. (and different than #1)

Thanks,
Chet