public
Description: This plugin gives WordPress the ability to read a set of web feeds and post their content online as a blog post. The feeds are stored locally and can be filtered using a set of search terms and categories.
Homepage: https://redmine.shaneandpeter.com/projects/show/wp-syndication
Clone URL: git://github.com/edavis10/syndicated-posting-plugin.git
100755 68 lines (53 sloc) 1.889 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env ruby
require "fileutils"
 
require 'rake/clean'
CLEAN.include('**/semantic.cache','./syndicated-posting.zip')
 
PLUGIN_FOLDER = '/var/www/blog1/wp-content/plugins'
SRC_FOLDER = '/home/edavis/dev/Business/Customers/Shane-and-Peter/syndication-plugin/trunk'
ZIP_FILE = SRC_FOLDER + "/syndicated-posting.zip"
 
desc "Copy the plugin source to the plugin folder"
task :copy => [:remove] do
  cp_r("#{SRC_FOLDER}/syndicated-posting", "#{PLUGIN_FOLDER}")
end
 
desc "Remove the plugin source from the plugin folder"
task :remove do
  rm_rf("#{PLUGIN_FOLDER}/syndicated-posting")
end
 
desc "Zip of the folder for release"
task :zip => [:clean, :doc] do
  require 'zip/zip'
  require 'zip/zipfilesystem'
  
  # check to see if the file exists already, and if it does, delete it.
  if File.file?(ZIP_FILE)
    File.delete(ZIP_FILE)
  end
 
  # open or create the zip file
  Zip::ZipFile.open(ZIP_FILE, Zip::ZipFile::CREATE) do |zipfile|
    # Should skip svn files
    files = Dir['syndicated-posting/**/*.*']
 
    files.each do |file|
      print "Adding #{file} ...."
      zipfile.add(file, file)
      puts ". done"
    end
  end
  
  # set read permissions on the file
  File.chmod(0644, ZIP_FILE)
end
 
desc "Upload zip file to server"
task :upload => [:zip] do
  dest = 'downloads.littlestreamsoftware.com/syndicated-posting/'
  system("scp -oPort=44444 #{ZIP_FILE} littlestreamsoftware.com:/home/websites/#{dest}")
  puts "File is at http://#{dest}syndicated-posting.zip"
end
 
desc "Purge the wp_posts table for testing"
task :purge_db do
  db = ENV['DB'] || 'wordpress'
  user = ENV['DBUSER'] || 'root'
  system("echo 'TRUNCATE TABLE wp_posts;' | mysql -u #{user} -p #{db}")
end
 
desc "Create the HTML docs from the txt"
task :doc do
  system("markdown #{SRC_FOLDER}/syndicated-posting/README.txt > #{SRC_FOLDER}/syndicated-posting/README.html")
end
 
 
task :default => [:copy]