Permalink
Browse files

Moved classes to folder and created config file

  • Loading branch information...
1 parent b3c9de4 commit c3ac1a7a153ab4dfd8b5089eb9a7ebb3f525b9a1 Ovidiu Chereches committed Feb 29, 2012
Showing with 39 additions and 13 deletions.
  1. +2 −1 .gitignore
  2. 0 { → class}/city.php
  3. +0 −2 { → class}/map.php
  4. +10 −0 config.sample.php
  5. +6 −1 generate.php
  6. +21 −9 upload.php
View
@@ -1 +1,2 @@
-exports
+config.php
+exports/*
File renamed without changes.
@@ -1,7 +1,5 @@
<?php
-include('city.php');
-
class Map
{
private $cities;
View
@@ -0,0 +1,10 @@
+<?php
+
+/*
+ Create your own app at https://dev.twitter.com/apps.
+*/
+
+$consumer_key = 'xxxxxx';
+$consumer_secret = 'xxxxxx';
+$user_token = 'xxxxxx';
+$user_secret = 'xxxxxx';
View
@@ -1,6 +1,11 @@
<?php
-include('map.php');
+// Lib
+
+include('class/city.php');
+include('class/map.php');
+
+// Map
$map = new Map;
$map->output();
View
@@ -1,20 +1,25 @@
<?php
-include('map.php');
-
// Lib
include('lib/tmhOAuth/tmhOAuth.php');
include('lib/tmhOAuth/tmhUtilities.php');
+include('class/city.php');
+include('class/map.php');
+
+// Config
+
+include('config.php');
+
// Auth
$tmhOAuth = new tmhOAuth(array
(
- 'consumer_key' => 'xxxxxx',
- 'consumer_secret' => 'xxxxxx',
- 'user_token' => 'xxxxxx',
- 'user_secret' => 'xxxxxx',
+ 'consumer_key' => $consumer_key,
+ 'consumer_secret' => $consumer_secret,
+ 'user_token' => $user_token,
+ 'user_secret' => $user_secret,
));
// Path
@@ -27,10 +32,11 @@
(
$path = 'exports/' . time() . '.jpg'
);
+$name = $pathinfo['basename'];
-// Generate
+// Map
-$map = new Map();
+$map = new Map;
if(!$map->save($path) || !$path = realpath($path))
{
@@ -39,9 +45,15 @@
// Params
+$image = array
+(
+ "@$path",
+ 'type=image/jpeg',
+ "filename=$name"
+);
$params = array
(
- 'image' => "@$path;type=image/jpeg;filename={$pathinfo['basename']}",
+ 'image' => implode(';', $image),
'use' => 'true'
);

0 comments on commit c3ac1a7

Please sign in to comment.