Skip to content

Commit

Permalink
Merge master to resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sathishkumar Natesan committed Nov 12, 2013
2 parents 8905994 + 74b51ba commit f4e3ed2
Show file tree
Hide file tree
Showing 41 changed files with 456 additions and 173 deletions.
3 changes: 0 additions & 3 deletions ApiExample.cpp/compile.sh

This file was deleted.

26 changes: 0 additions & 26 deletions ApiExample.cpp/include/HTTPDownload.h

This file was deleted.

26 changes: 0 additions & 26 deletions ApiExample.cpp/include/TCPSocket.h

This file was deleted.

28 changes: 0 additions & 28 deletions ApiExample.cpp/include/main.h

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ The Ohloh API is a free, REST-based programming interface to the Ohloh open sour

This page contains important summary information to help you get started. In-depth online documentation is available, linked by the table of contents below.

Some sample code can be found on the [Examples](examples.md) page. For questions not covered in the documenation, the [Ohloh API forum](http://www.ohloh.net/forums/3492) can provide additional help.
Some sample code can be found on the [Examples](examples/) page. For questions not covered in the documenation, the [Ohloh API forum](http://www.ohloh.net/forums/3492) can provide additional help.

Send bug reports to info@ohloh.net.

## Table of Contents
+ [Lookup By Email](email_lookup.md)
+ [Using OAuth with the Ohloh API](oauth.md)
+ [Examples](examples.md)
+ [Using OAuth with the Ohloh API](examples/oauth)
+ [Examples](examples/)
+ Ohloh API Reference
- [Account](reference/account.md)
- [Account News](reference/news.md)
Expand Down Expand Up @@ -71,7 +71,7 @@ The standard Ohloh API allows read-only access to Ohloh data.

Using OAuth, you can impersonate an Ohloh account while accessing the Ohloh API. This enables you to write to the Ohloh database, and also to access or modify private account information. You must first be granted permission to do this by an Ohloh account holder.

You can read more at [Using OAuth with the Ohloh API](oauth.md).
You can read more at [Using OAuth with the Ohloh API](examples/oauth#using-oauth-with-the-ohloh-api).

## Forming a Request

Expand All @@ -87,7 +87,7 @@ You must do three things to receive an XML-formatted response:
For example, to view the project with ID=1 as XML, using an example API key, the complete URL would be:

```
http://www.ohloh.net/projects/1.xml?api_key=01234567890123456789
http://www.ohloh.net/projects/1.xml?api_key=01234567890123456789
```

For the sake of brevity, the `api_key` parameter will be omitted from the examples in this documentation. Remember to always include it in your actual queries.
Expand Down Expand Up @@ -160,7 +160,7 @@ Details about this project response can be found in the Ohloh API Reference [pro
For example, to get the second page of projects containing “java” or “Java” in their titles, descriptions, or tags, you would request:

```
GET http://www.ohloh.net/projects.xml?query=java&page=2
GET http://www.ohloh.net/projects.xml?query=java&page=2
```

### Collection Response XML Format
Expand Down
39 changes: 0 additions & 39 deletions account_sample.sh

This file was deleted.

File renamed without changes.
25 changes: 25 additions & 0 deletions examples/ApiExample.cpp/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh
# The MIT License (MIT)
#
# Copyright (c) 2013 Lars Wesselius
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

cd src/
make
50 changes: 50 additions & 0 deletions examples/ApiExample.cpp/include/HTTPDownload.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
The MIT License (MIT)
Copyright (c) 2013 Lars Wesselius
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#ifndef __HTTPDOWNLOAD_H__
#define __HTTPDOWNLOAD_H__

#include "TCPSocket.h"

#include <fstream>
#include <string>

class HTTPDownload
{
public:
HTTPDownload(void) { }
virtual ~HTTPDownload(void) { }

bool start(const std::string &url);
void stop(void);

protected:
bool _parseHeader(const std::string &header);
bool _download(const std::string &url);

TCPSocket *mSocket;
std::ofstream mFile;
};

#endif
50 changes: 50 additions & 0 deletions examples/ApiExample.cpp/include/TCPSocket.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
The MIT License (MIT)
Copyright (c) 2013 Lars Wesselius
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#ifndef __TCP_SOCKET_H__
#define __TCP_SOCKET_H__


#include <string>

class TCPSocket
{
public:
TCPSocket(void);
~TCPSocket(void);

void connect(const std::string &server, const int &port);
void disconnect(void);
bool connected(void) { return mSocket; }

void send(const std::string &msg);
int recieve(std::string &ret);
bool eof(void) { return mEOF; }

protected:
int mSocket;
bool mEOF;
};

#endif
52 changes: 52 additions & 0 deletions examples/ApiExample.cpp/include/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
The MIT License (MIT)
Copyright (c) 2013 Lars Wesselius
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#ifndef __MAIN_H__
#define __MAIN_H__

#if defined( __WIN32__ ) || defined( _WIN32 )
# define OS_WINDOWS
# include <winsock.h>
#else
# define OS_LINUX
# include <unistd.h>
# include <errno.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <sys/time.h>
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
# include <fcntl.h>
#endif

#include <string>
#include <stdio.h>


std::pair<std::string, std::string> parseCommandLine(int argc, const char * argv[]);
void parseAndShowResult();

#endif

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
The MIT License (MIT)
Copyright (c) 2013 Lars Wesselius
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#include "HTTPDownload.h"

#include <cstdlib>
Expand Down
Loading

0 comments on commit f4e3ed2

Please sign in to comment.