<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Suchanfrage senden und Suchergebnisse zurückerhalten]]></title><description><![CDATA[<p>Hallo liebe C plü plü ler ^^</p>
<p>Ich weiß nicht, ob ihr mir helfen könntet?</p>
<p>Ich möchte gerne von einem EDIT Feld aus etwas reinschreiben.</p>
<p>Wenn ich jetzt auf den Button drücken möchte, dann Soll dieses reingeschriebe auf <a href="http://google.de" rel="nofollow">google.de</a>'s eigene EDIT-Feld übertragen werden. Automatisch muss dabei auf das Feld &quot;Google-Suche&quot; gedrückt werden.</p>
<p>Siehe Bild Nummer Eins:</p>
<p><a href="http://img532.imageshack.us/img532/7615/problembild1cplusplusde.png" rel="nofollow">http://img532.imageshack.us/img532/7615/problembild1cplusplusde.png</a></p>
<p>Danach sollen die ersten 3 Suchergebnisse <strong>(NUR Überschrift)</strong> wieder von <a href="http://google.de" rel="nofollow">google.de</a> auf mein Programm übertragen werden.</p>
<p>Siehe Bild Nummer Zwei:</p>
<p><a href="http://img532.imageshack.us/img532/9770/problembild2cplusplusde.png" rel="nofollow">http://img532.imageshack.us/img532/9770/problembild2cplusplusde.png</a></p>
<p>Wie realisiere ich dieses Programm am Besten?</p>
<p>Ich benutze zZ Borland 6 auf GUI.</p>
<p>MfG</p>
<p>CiPlüPlü</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/264658/suchanfrage-senden-und-suchergebnisse-zurückerhalten</link><generator>RSS for Node</generator><lastBuildDate>Thu, 03 Sep 2026 23:34:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/264658.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Apr 2010 19:40:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sat, 10 Apr 2010 20:26:18 GMT]]></title><description><![CDATA[<p>Hallo liebe C plü plü ler ^^</p>
<p>Ich weiß nicht, ob ihr mir helfen könntet?</p>
<p>Ich möchte gerne von einem EDIT Feld aus etwas reinschreiben.</p>
<p>Wenn ich jetzt auf den Button drücken möchte, dann Soll dieses reingeschriebe auf <a href="http://google.de" rel="nofollow">google.de</a>'s eigene EDIT-Feld übertragen werden. Automatisch muss dabei auf das Feld &quot;Google-Suche&quot; gedrückt werden.</p>
<p>Siehe Bild Nummer Eins:</p>
<p><a href="http://img532.imageshack.us/img532/7615/problembild1cplusplusde.png" rel="nofollow">http://img532.imageshack.us/img532/7615/problembild1cplusplusde.png</a></p>
<p>Danach sollen die ersten 3 Suchergebnisse <strong>(NUR Überschrift)</strong> wieder von <a href="http://google.de" rel="nofollow">google.de</a> auf mein Programm übertragen werden.</p>
<p>Siehe Bild Nummer Zwei:</p>
<p><a href="http://img532.imageshack.us/img532/9770/problembild2cplusplusde.png" rel="nofollow">http://img532.imageshack.us/img532/9770/problembild2cplusplusde.png</a></p>
<p>Wie realisiere ich dieses Programm am Besten?</p>
<p>Ich benutze zZ Borland 6 auf GUI.</p>
<p>MfG</p>
<p>CiPlüPlü</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880740</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Sat, 10 Apr 2010 20:26:18 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sat, 10 Apr 2010 22:51:31 GMT]]></title><description><![CDATA[<p>Da muss wohl eine externe library her. Mit Boost::Asio und einem HTTP-Clienten solltest du da richtig bedient sein. Du kannst da sicher etwas mit den HTTP-Befehlen hantieren, aber ich würde einfach den Google-Link generieren und dann eine Anfrage stellen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880784</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Sat, 10 Apr 2010 22:51:31 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sat, 10 Apr 2010 23:37:52 GMT]]></title><description><![CDATA[<p><a href="http://www.google.de/accounts/TOS?loc=DE" rel="nofollow">http://www.google.de/accounts/TOS?loc=DE</a></p>
<p>Insbesondere 4. - :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880802</guid><dc:creator><![CDATA[EOP]]></dc:creator><pubDate>Sat, 10 Apr 2010 23:37:52 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sun, 11 Apr 2010 07:25:02 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20193">@Kóyaánasqatsi</a>:</p>
<p>Eine externe Library also, vielen Dank für die Antwort trotzdem <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/16940">@EOP</a>:</p>
<p>Pffff ich bin kein DdoS-ler (Kiddie) und verspamme die Seite mit unendliche Anfragen ;o)</p>
<p>/e: Wolltet ihr mir was sagen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880848</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Sun, 11 Apr 2010 07:25:02 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sun, 11 Apr 2010 07:41:43 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-169861.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-169861.html</a><br />
fürs verständnis oder selber machen.</p>
<p><a href="http://curl.haxx.se/" rel="nofollow">http://curl.haxx.se/</a><br />
eignet sich auch fürs Umsetzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880855</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 11 Apr 2010 07:41:43 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sun, 11 Apr 2010 11:18:18 GMT]]></title><description><![CDATA[<p>Ich hoffe, du verstehst mich nicht falsch, aber gebe es nicht etwas viel einfacheres? Ich will nicht quasi das Rad neu erfinden, sondern nur einen einzeiler im HTML Format auf C++ zu bringen.</p>
<p>Dennoc versuche ich es mit dem vorgeschlagene Links, sieht mir sehr kompliziert aus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Wenigstens habe ich es geschafft von C++ aus eine Google anfrage zu stellen und mittels CppWebBrowser diese anzuzeigen (Link + das gesuchte Wort ^^)</p>
<p>Geht es wirklich nicht einfache nur einen einzigen Wert (nämlich die Überschrift) automatisch rauszukopieren und mittels Label-Feld diese auszugeben (Siehe Grafik 2; Post 1)</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880978</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Sun, 11 Apr 2010 11:18:18 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sun, 11 Apr 2010 11:26:49 GMT]]></title><description><![CDATA[<p>CiPlüPlü schrieb:</p>
<blockquote>
<p>Geht es wirklich nicht einfache nur einen einzigen Wert (nämlich die Überschrift) automatisch rauszukopieren und mittels Label-Feld diese auszugeben</p>
</blockquote>
<p>Nicht mit C++. HTTP, HTML, Sockets und &quot;Label-Feld&quot; gibt es dort nicht, zumindest nicht ohne externe Bibliotheken zu bemühen. Was einfacheres als Curl dürfte kaum aufzutreiben sein.</p>
<p>Vielleicht wäre ja eine andere Sprache, zB. Python das bessere Werkzeug dafür?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1880984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1880984</guid><dc:creator><![CDATA[Nukularfüsiker]]></dc:creator><pubDate>Sun, 11 Apr 2010 11:26:49 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Sun, 11 Apr 2010 14:17:17 GMT]]></title><description><![CDATA[<p>/e:</p>
<p>Wow vielen Dank!</p>
<p>Nachdem ich &quot;curl --ssl <a href="http://www.google.de" rel="nofollow">www.google.de</a>&quot; als Test eingegeben habe, sehe ich nun den ganzen Quelltext! Vielen Dank!</p>
<p>Nun muss ich noch die Datei auslesen und fertig!!!</p>
<p>Vielen Dank nochmal dafür!</p>
<p>Mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1881003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1881003</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Sun, 11 Apr 2010 14:17:17 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Mon, 12 Apr 2010 13:56:31 GMT]]></title><description><![CDATA[<p>So nun klappt alles soweit, aber ich habe noch ein kleines Problem:</p>
<p>Wie übergebe ich nun die Charvariable auf system(&quot;&quot;) ???</p>
<p>Ich habe es zwar so gelöst:</p>
<p>*<em>const char <em>Wert = Edit1-&gt;Text.c_str();</em></em></p>
<p>aber davor und dahinter gibt er mir immer Assemblerwerte aus.</p>
<p>z.B:</p>
<p>statt C:\txt.txt macht er <strong>³4$C:\txt.txt~'</strong>{</p>
<p>Wie löse ich das Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1881610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1881610</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Mon, 12 Apr 2010 13:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Mon, 12 Apr 2010 14:11:45 GMT]]></title><description><![CDATA[<p>Hat google nicht 'ne API dafuer? <a href="http://code.google.com/apis/soapsearch/api_faq.html" rel="nofollow">http://code.google.com/apis/soapsearch/api_faq.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1881614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1881614</guid><dc:creator><![CDATA[knivil]]></dc:creator><pubDate>Mon, 12 Apr 2010 14:11:45 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Thu, 15 Apr 2010 13:38:09 GMT]]></title><description><![CDATA[<p>----------------------------<br />
----------------------------<br />
----------------------------</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1881769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1881769</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Thu, 15 Apr 2010 13:38:09 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Wed, 14 Apr 2010 20:54:48 GMT]]></title><description><![CDATA[<p>Wie, schon erledigt? Naja, wollte auch was posten, hatte dann aber keine Lust weiterzuproggen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Hier der Code, irgendwo ist noch ein Bug:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;utility&gt;

#include &lt;boost/asio.hpp&gt;
#include &lt;boost/utility.hpp&gt;
#include &lt;boost/scoped_ptr.hpp&gt;
#include &lt;boost/thread.hpp&gt;
#include &lt;boost/bind.hpp&gt;
#include &lt;boost/algorithm/string.hpp&gt; 

template &lt;typename T&gt;
class AsyncHTTPClient : boost::noncopyable
{
	public:
		AsyncHTTPClient(std::string Host,
						const std::string &amp;Port = &quot;80&quot;);

		const std::vector&lt;char&gt; GetWebPageContent() const
		{ return m_Buffer; }

	private:
		boost::asio::io_service							  m_IOService;
		boost::scoped_ptr&lt;boost::asio::ip::tcp::resolver&gt; m_pResolver;
		boost::asio::ip::tcp::resolver::query             m_Query;
		boost::asio::ip::tcp::socket					  m_Socket;
		std::vector&lt;T&gt;                                    m_Buffer;     
		const std::string                                 m_Host;
		boost::scoped_ptr&lt;boost::thread&gt;				  m_pThread; 

		void ResolveSuceeded(const boost::system::error_code &amp;Error,
							 boost::asio::ip::tcp::resolver::iterator it);

		void ConnectSuceeded(const boost::system::error_code &amp;Error);

		void ResultOfQuery(const boost::system::error_code&amp; Error, 
						   std::size_t bytes_transferred);

		const std::pair&lt;std::string, std::string&gt; SplitUrl(std::string Url) const;
};

template &lt;typename T&gt;
AsyncHTTPClient&lt;T&gt;::AsyncHTTPClient(std::string Host,
								    const std::string &amp;Port) :
	m_IOService(boost::asio::io_service::io_service()),
	m_pResolver(new boost::asio::ip::tcp::resolver(m_IOService)),
	m_Query(boost::asio::ip::tcp::resolver::query(&quot;www.google.de&quot;, Port)),
	m_Socket(m_IOService),
	m_Buffer(1500),
	m_Host(Host)
	{
		m_pResolver-&gt;async_resolve
		(
			m_Query,
			boost::bind(&amp;AsyncHTTPClient::ResolveSuceeded, this, _1, _2)
		);

		m_pThread.reset(new boost::thread
		(
			boost::bind(&amp;boost::asio::io_service::run, &amp;m_IOService))
		);
	}

template &lt;typename T&gt;
void AsyncHTTPClient&lt;T&gt;::ResolveSuceeded(const boost::system::error_code &amp;Error,
									     boost::asio::ip::tcp::resolver::iterator it)
{
	if(Error)
	{
		std::cout&lt;&lt;&quot;Error:&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt; boost::system::system_error(Error).what() &lt;&lt;std::endl;
	}
	else
	{
		std::cout&lt;&lt;&quot;... Resolve at &quot;&lt;&lt; SplitUrl(m_Host).first &lt;&lt;&quot; suceeded&quot;&lt;&lt;std::endl;

		m_Socket.async_connect
		(
			*it, 
			boost::bind(&amp;AsyncHTTPClient::ConnectSuceeded, this, _1)
		);
	}
}

template &lt;typename T&gt;
void AsyncHTTPClient&lt;T&gt;::ConnectSuceeded(const boost::system::error_code &amp;Error)
{
	if(Error)
	{
		std::cout&lt;&lt;&quot;Error:&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt; boost::system::system_error(Error).what() &lt;&lt;std::endl;
	}
	else
	{
		std::cout&lt;&lt;&quot;... Connect to &quot;&lt;&lt; SplitUrl(m_Host).first &lt;&lt;&quot; suceeded&quot;&lt;&lt;std::endl;

		std::string GET(&quot;GET &quot;);
		GET += SplitUrl(m_Host).second;
		GET += &quot; Host: www.google.de&quot;;

		boost::asio::write(m_Socket, boost::asio::buffer(GET)); 

		m_Socket.async_read_some
		(
			boost::asio::buffer(m_Buffer, 1500),
			boost::bind(&amp;AsyncHTTPClient::ResultOfQuery, this, _1, _2)
		);
	}
}

template &lt;typename T&gt;
void AsyncHTTPClient&lt;T&gt;::ResultOfQuery(const boost::system::error_code&amp; Error, 
							           std::size_t bytes_transferred)
{ 	
	if(Error)
	{
		std::cout&lt;&lt;&quot;Error:&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt; boost::system::system_error(Error).what() &lt;&lt;std::endl;
	}
	else
	{
		std::cout&lt;&lt;&quot;... Successfully connected to DNS-Server&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt;&quot;... &quot;&lt;&lt; bytes_transferred &lt;&lt;&quot;Bytes transferred&quot;&lt;&lt;std::endl;
	}
}

template &lt;typename T&gt;
const std::pair&lt;std::string, std::string&gt; AsyncHTTPClient&lt;T&gt;::SplitUrl(std::string Url) const
{
	std::pair&lt;std::string, std::string&gt; UrlPair;

	UrlPair.second = Url.substr(Url.find(std::string(&quot;/&quot;)));

	Url.erase(Url.find(std::string(&quot;/&quot;), (Url.size() - UrlPair.second.size())));

	UrlPair.first = Url;

	return UrlPair;
}

/// Formal characters not supported
class GoogleLinkBuilder : boost::noncopyable
{
	public:
		const std::string BuildLink(const std::string &amp;Keyword)
		{
			std::string Link(&quot;www.google.de/search?hl=de&amp;safe=off&amp;q=&quot;);
			Link += Keyword;
			Link += &quot;&amp;meta=&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=&quot;;

			return Link;
		}
};

class GoogleResultParser : boost::noncopyable,
						   public GoogleLinkBuilder
{
	public:
		GoogleResultParser(const std::string &amp;Keyword);

	private:
		boost::scoped_ptr&lt;AsyncHTTPClient&lt;char&gt;&gt; m_pClient;
		boost::scoped_ptr&lt;boost::thread&gt;         m_pThread;
		bool									 m_StopLoop;

		void CheckBuffer();
		void ParseResults(const std::vector&lt;char&gt; &amp;Results) const;
};

GoogleResultParser::GoogleResultParser(const std::string &amp;Keyword) :
	m_pClient(new AsyncHTTPClient&lt;char&gt;(BuildLink(Keyword))),
	m_pThread
	(
		new boost::thread(boost::bind(&amp;GoogleResultParser::CheckBuffer, this))
	),
	m_StopLoop(false)
	{ }

void GoogleResultParser::CheckBuffer()
{
	while(m_StopLoop == false)
	{
		if(!m_pClient-&gt;GetWebPageContent().empty())
		{
			ParseResults(m_pClient-&gt;GetWebPageContent());

			m_StopLoop = true;
		}
	}
}

void GoogleResultParser::ParseResults(const std::vector&lt;char&gt; &amp;Results) const
{
	std::cout&lt;&lt;&quot;Results != empty&quot;;

	for(std::vector&lt;char&gt;::const_iterator it(Results.begin());
		it != Results.end();
		++it)
		std::cout&lt;&lt; *it &lt;&lt;std::endl;
}

int main()
{
	std::string Keyword;

	std::cout&lt;&lt;&quot;Keyword: &quot;&lt;&lt;std::endl;
	std::cin&gt;&gt;Keyword;

	GoogleResultParser parser(Keyword);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1883059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883059</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Wed, 14 Apr 2010 20:54:48 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Wed, 14 Apr 2010 21:28:40 GMT]]></title><description><![CDATA[<p>Achja habe den Parser noch nicht weitergemacht. Aber das ist ja das einfachste.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883077</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Wed, 14 Apr 2010 21:28:40 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Thu, 15 Apr 2010 13:39:24 GMT]]></title><description><![CDATA[<p>Entschuldigung dass ich so voreilig war ^^</p>
<p>Ist das DEV++ Grafisch oder welches Programm?</p>
<p>Der Quellcode sieht geil aus xD</p>
<p>Ich wusste nedd, dass man auch Anfragen (PHP) direkt aus C++ machen kann xD</p>
<p>Wenn ich gestehen kann, soweit bin ich nun doch nicht :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883370</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Thu, 15 Apr 2010 13:39:24 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Thu, 15 Apr 2010 18:28:50 GMT]]></title><description><![CDATA[<p>Das hat mit PHP nichts zu tun. Was du machst ist eine Anfrage (HTTP) an den Server senden und der gibt dir dann Antwort. Wie er die Antwort macht (also mit PHP, Ruby usw.) spielt keine Rolle. Theoretisch könnte da sogar ein Typ sitzen, welcher dir auf Anfrage eine neue Seite tippt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883536</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Thu, 15 Apr 2010 18:28:50 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Thu, 15 Apr 2010 18:34:22 GMT]]></title><description><![CDATA[<p>CiPlüPlü schrieb:</p>
<blockquote>
<p>Entschuldigung dass ich so voreilig war ^^</p>
</blockquote>
<p>Äh, wie? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883538</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Thu, 15 Apr 2010 18:34:22 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Thu, 15 Apr 2010 20:20:05 GMT]]></title><description><![CDATA[<p>Kóyaánasqatsi schrieb:</p>
<blockquote>
<p>CiPlüPlü schrieb:</p>
<blockquote>
<p>Entschuldigung dass ich so voreilig war ^^</p>
</blockquote>
<p>Äh, wie? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
</blockquote>
<p>Lol das war bezogen auf das Thema, das ich gesagt hatte das sichs erledigt habe. Dem war es eben nicht so und ...</p>
<p>dann sagte ich halt:</p>
<p>Entschuldigung dass ich so voreilig war ^^</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883579</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Thu, 15 Apr 2010 20:20:05 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Thu, 15 Apr 2010 20:45:04 GMT]]></title><description><![CDATA[<p>Achsou <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
Kannst du das den noch gebrauchen? Weil sonst landet das gleich im Mülleimer <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883592</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883592</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Thu, 15 Apr 2010 20:45:04 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Fri, 16 Apr 2010 11:13:33 GMT]]></title><description><![CDATA[<p>Kóyaánasqatsi schrieb:</p>
<blockquote>
<p>Achsou <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
Kannst du das den noch gebrauchen? Weil sonst landet das gleich im Mülleimer <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
</blockquote>
<p>Ich weiß nicht, mit welchem Programm du es gebastelt hast, weil ich es noch nicht getestet habe, aber lösche den Quellcode trotzdem nicht!</p>
<p>Und ja ich kann es wahrscheinlich gebrauchen ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883782</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883782</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Fri, 16 Apr 2010 11:13:33 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Fri, 16 Apr 2010 11:59:01 GMT]]></title><description><![CDATA[<p>CiPlüPlü schrieb:</p>
<blockquote>
<p>Ich weiß nicht, mit welchem Programm du es gebastelt hast</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Boost^^. Ist kein Programm sondern ne lib. Kannste dir 4free im Netz saugen^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883802</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Fri, 16 Apr 2010 11:59:01 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Fri, 16 Apr 2010 14:01:57 GMT]]></title><description><![CDATA[<p>Ach du schande, ich habe nun ein Ordner entpackt, welcher ca. 40.000 Dateien enthält.</p>
<p>Muss ich den ganzen Ordner in meiner C++ bearbeitungsdateien beifügen oder reicht schon ein PATH aus?</p>
<p>Und nochmal zur Erinnerung: Es ist noch aktuell ^^</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1883872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1883872</guid><dc:creator><![CDATA[CiPlüPlü]]></dc:creator><pubDate>Fri, 16 Apr 2010 14:01:57 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Mon, 26 Apr 2010 17:02:46 GMT]]></title><description><![CDATA[<p>*PUSH*</p>
<p>So nach langer Zeit habe ich dennoch eine Frage:</p>
<p>Wie bekomme ich den ganzen Quelltext in einer char Variable untergebracht???</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1888589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1888589</guid><dc:creator><![CDATA[CiPlüPlü(unregistered)]]></dc:creator><pubDate>Mon, 26 Apr 2010 17:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Mon, 26 Apr 2010 18:30:44 GMT]]></title><description><![CDATA[<p>CiPlüPlü(unregistered) schrieb:</p>
<blockquote>
<p>Wie bekomme ich den ganzen Quelltext in einer char Variable untergebracht???</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
LOL. Wenn du das schaffst, dann melde bitte die Technik beim Patentamt, weil du dann verdammt schnell unheimlich reich wirst (Sofern der untergebrachte Quelltext nicht nur aus einem Zeichen besteht). <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Was ich damit sagen will ist, dass ein <code>char</code> lediglich (wie es der Name sagt) 1 Zeichen aufnehmen kann. Du suchst eher nach einem string, wie z.B <code>std::string</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1888621</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1888621</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Mon, 26 Apr 2010 18:30:44 GMT</pubDate></item><item><title><![CDATA[Reply to Suchanfrage senden und Suchergebnisse zurückerhalten on Mon, 26 Apr 2010 19:28:28 GMT]]></title><description><![CDATA[<p>So, hatte vor nen paar Wochen nochmal die HTTP-Anfrage miteingebaut. Habe nur keine zeit mehr zum proggen, weil wegen Freundinn <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;string&gt;
#include &lt;utility&gt;

#include &lt;boost/asio.hpp&gt;
#include &lt;boost/utility.hpp&gt;
#include &lt;boost/scoped_ptr.hpp&gt;
#include &lt;boost/thread.hpp&gt;
#include &lt;boost/bind.hpp&gt;
#include &lt;boost/algorithm/string.hpp&gt; 

template &lt;typename T&gt;
class AsyncHTTPClient : boost::noncopyable
{
	public:
		AsyncHTTPClient(std::string Host,
			            boost::asio::io_service &amp;IOService,
						const std::string &amp;Port = &quot;80&quot;);

		const std::vector&lt;char&gt; GetWebPageContent() const
		{ return m_Buffer; }

	private:
		boost::scoped_ptr&lt;boost::asio::ip::tcp::resolver&gt; m_pResolver;
		boost::asio::ip::tcp::resolver::query             m_Query;
		boost::asio::ip::tcp::socket					  m_Socket;
		std::vector&lt;T&gt;                                    m_Buffer;     
		const std::string                                 m_Host;

		void ResolveSuceeded(const boost::system::error_code &amp;Error,
							 boost::asio::ip::tcp::resolver::iterator it);

		void ConnectSuceeded(const boost::system::error_code &amp;Error);

		void ResultOfQuery(const boost::system::error_code&amp; Error, 
						   std::size_t bytes_transferred);

		const std::pair&lt;std::string, std::string&gt; SplitUrl(std::string Url) const;
};

template &lt;typename T&gt;
AsyncHTTPClient&lt;T&gt;::AsyncHTTPClient(std::string Host,
									boost::asio::io_service &amp;IOService,
								    const std::string &amp;Port) :
	m_pResolver(new boost::asio::ip::tcp::resolver(IOService)),
	m_Query(boost::asio::ip::tcp::resolver::query(&quot;www.google.de&quot;, Port)),
	m_Socket(IOService),
	m_Buffer(1500),
	m_Host(Host)
	{
		m_pResolver-&gt;async_resolve
		(
			m_Query,
			boost::bind(&amp;AsyncHTTPClient::ResolveSuceeded,
										  this, 
										  boost::asio::placeholders::error, 
										  boost::asio::placeholders::iterator)
		);
	}

template &lt;typename T&gt;
void AsyncHTTPClient&lt;T&gt;::ResolveSuceeded(const boost::system::error_code &amp;Error,
									     boost::asio::ip::tcp::resolver::iterator it)
{
	if(Error)
	{
		std::cout&lt;&lt;&quot;Error:&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt; boost::system::system_error(Error).what() &lt;&lt;std::endl;
	}
	else
	{
		std::cout&lt;&lt;&quot;... Resolve at &quot;&lt;&lt; SplitUrl(m_Host).first &lt;&lt;&quot; suceeded&quot;&lt;&lt;std::endl;

		boost::system::error_code error = boost::asio::error::host_not_found;

		boost::asio::ip::tcp::endpoint EndPoint = *it;

		m_Socket.async_connect
		(
			EndPoint, 
			boost::bind(&amp;AsyncHTTPClient::ConnectSuceeded, this, boost::asio::placeholders::error)
		);
	}
}

template &lt;typename T&gt;
void AsyncHTTPClient&lt;T&gt;::ConnectSuceeded(const boost::system::error_code &amp;Error)
{
	if(Error)
	{
		std::cout&lt;&lt;&quot;Error:&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt; boost::system::system_error(Error).what() &lt;&lt;std::endl;
	}
	else
	{
		std::cout&lt;&lt;&quot;... Connect to &quot;&lt;&lt; SplitUrl(m_Host).first &lt;&lt;&quot; suceeded&quot;&lt;&lt;std::endl;

		std::string GET(&quot;GET &quot;);
		GET += SplitUrl(m_Host).second;
		GET += &quot; Host: www.google.de&quot;;

		boost::asio::write(m_Socket, boost::asio::buffer(GET)); 

		m_Socket.async_read_some
		(
			boost::asio::buffer(m_Buffer, 1500),
			boost::bind(&amp;AsyncHTTPClient::ResultOfQuery, this, boost::asio::placeholders::error, _2)
		);
	}
}

template &lt;typename T&gt;
void AsyncHTTPClient&lt;T&gt;::ResultOfQuery(const boost::system::error_code&amp; Error, 
							           std::size_t bytes_transferred)
{ 	
	if(Error)
	{
		std::cout&lt;&lt;&quot;Error:&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt; boost::system::system_error(Error).what() &lt;&lt;std::endl;
	}
	else
	{
		std::cout&lt;&lt;&quot;... Successfully connected to DNS-Server&quot;&lt;&lt;std::endl;
		std::cout&lt;&lt;&quot;... &quot;&lt;&lt; bytes_transferred &lt;&lt;&quot;Bytes transferred&quot;&lt;&lt;std::endl;
	}
}

template &lt;typename T&gt;
const std::pair&lt;std::string, std::string&gt; AsyncHTTPClient&lt;T&gt;::SplitUrl(std::string Url) const
{
	std::pair&lt;std::string, std::string&gt; UrlPair;

	UrlPair.second = Url.substr(Url.find(std::string(&quot;/&quot;)));

	Url.erase(Url.find(std::string(&quot;/&quot;), (Url.size() - UrlPair.second.size())));

	UrlPair.first = Url;

	return UrlPair;
}

/// Formal characters not supported
class GoogleLinkBuilder : boost::noncopyable
{
	public:
		const std::string BuildLink(const std::string &amp;Keyword)
		{
			std::string Link(&quot;www.google.de/search?hl=de&amp;safe=off&amp;q=&quot;);
			Link += Keyword;
			Link += &quot;&amp;meta=&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=&quot;;

			return Link;
		}
};

class GoogleResultParser : boost::noncopyable,
						   public GoogleLinkBuilder
{
	public:
		GoogleResultParser(const std::string &amp;Keyword);

	private:
		boost::asio::io_service                  m_IOService;
		boost::scoped_ptr&lt;AsyncHTTPClient&lt;char&gt;&gt; m_pClient;
		boost::scoped_ptr&lt;boost::thread&gt;         m_pThread;
		boost::scoped_ptr&lt;boost::thread&gt;         m_pIOThread;
		bool									 m_StopLoop;
		std::vector&lt;char&gt;						 m_TempStorage;

		void CheckBuffer();
		void ParseResults(const std::vector&lt;char&gt; &amp;Results) const;
};

GoogleResultParser::GoogleResultParser(const std::string &amp;Keyword) :
	m_IOService(boost::asio::io_service()),
	m_pClient(new AsyncHTTPClient&lt;char&gt;(BuildLink(Keyword), m_IOService)),
	m_pThread
	(
		new boost::thread(boost::bind(&amp;GoogleResultParser::CheckBuffer, this))
	),
	m_pIOThread
	(
		new boost::thread(boost::bind(&amp;boost::asio::io_service::run, &amp;m_IOService))
	),
	m_StopLoop(false)
	{ }

void GoogleResultParser::CheckBuffer()
{
	m_TempStorage = m_pClient-&gt;GetWebPageContent();

	while(m_StopLoop == false)
	{
		if(!m_TempStorage.empty() &amp;&amp; m_TempStorage[0] != 0)
		{
			ParseResults(m_TempStorage);

			m_StopLoop = true;
		}
	}
}

void GoogleResultParser::ParseResults(const std::vector&lt;char&gt; &amp;Results) const
{
	std::cout&lt;&lt;&quot;Results != empty&quot;&lt;&lt;std::endl;

	for(std::vector&lt;char&gt;::const_iterator it(Results.begin());
		it != Results.end();
		++it)
		std::cout&lt;&lt; *it &lt;&lt;std::endl;
}

int main()
{
	std::string Keyword;

	std::cout&lt;&lt;&quot;Keyword: &quot;&lt;&lt;std::endl;
	std::cin&gt;&gt;Keyword;

	GoogleResultParser parser(Keyword);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1888656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1888656</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Mon, 26 Apr 2010 19:28:28 GMT</pubDate></item></channel></rss>