Checking steam profiles

using built in shell commands, I coded a quick and dirty (30 min) shell script to check steam profiles

lwp-request flushes the html into the stdio which I pipe into grep to sort out the only line relevant

I then use regex to determine the status of the target profile
then I have apps that show a pop up whenever the target’s status changes

there is a verbose mode (mainly for debugging) and a way to change the check rate of the script

usage ex: sh engieUNion -vt 5
this would put it in verbose mode, and change the refresh time to 5 seconds

-updated

#!/bin/bash

c=0
d=""
i=0
t=30
g=""
o=""
p=""
v=3
z=ZAMN

if [[ "$1" == *"t"* ]]
then
	t=$2
fi
if [[ "$1" == *"v"* ]]
then
	v=1
fi

while [ $i -lt 1 ]
do
	lwp-request -ft 100 http://steamcommunity.com/id/$z | grep 'profile_in_game\|steam://connect' > html
	o=$(cat html | grep "profile_in_game persona")

	if [[ "$o" == *"in-game"* ]] && [[ "$g" == *"Team Fortress 2"* ]]
 	then
	p=$(cat html | egrep -o '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\:[[:digit:]]{5}')
	g=$(cat html | grep "profile_in_game_name")
		if [ $c -ne 3 ]
		then
			c=3
			d=$(date)
			echo "$c" "        " "$d" 
			echo "$o" "         " "$g" | tee -a log		
			let "v = v+1"
			open inGame.app
		fi
		if [ $v -ne 2 ]
		then
			echo $g
		fi
		echo $p
	elif [[ "$o" == *"online"* ]]
	then
		if [ $c -ne 2 ]
		then
			c=2
			d=$(date)
			echo "$c" "        " "$d" "$o" | tee -a log
			let "v = v+1"
			open online.app
		fi
	elif [[ "$o" == *"offline"* ]]
	then
		if [ $c -ne 1 ]
		then
			c=1
			d=$(date)
			echo "$c" "        " "$d" "$o" | tee -a log
			let "v = v+1"
			open offline.app
		fi
	else
		v=2
		echo timeout
	fi

	if [ $v -eq 1 ]
	then
		echo "$c" "$o"
	elif [ $v -eq 2 ]
	then
		v=1
	fi

	sleep $t 	
done

Here is a C++ port:
-Justin

 

 

#include 
#include 
#include 
#include 
#include 
using namespace std;

int system(const char *command);

int main()
{

	std::string website = "http://steamcommunity.com/id/ZAMN";
//	std::cout << "Enter a website that you want to grab: "; 	//std::cin >> website;
	std::string command = "wget " + website;
	system(command.c_str());

	string search = "Currently Online";
	string line;

	ifstream inFile("Steam Community    -[o. W. n.]- No emaN.html");

	if (!inFile){
		cout << "Unable to open file" << endl;
		system("PAUSE");
		exit(1);

	}

	size_t pos;
	while (inFile.good())
	{
		getline(inFile, line); // get line from file
		pos = line.find(search); // search
		if (pos != string::npos) // string::npos is returned if string is not found
		{
			cout << "Found!";
			break;
		}
	}

	system("PAUSE");

}

The Engie Union

Team Fortress Sites

Some great sites for Tf2 trading:

http://backpack.tf/pricelist   (Best price list and most accurate so far, used almost by all trading servers)
http://www.tf2outpost.com/ (Best site for trading items with other people, extremely popular, wouldn’t recommend it for beginners because its filled with scammers. You can also find if items are duplicated here.)
http://tf2spreadsheet.traderempire.com/   (Another decent price list, I like it because it has free trustable raffles)
http://tf2tp.com/ (Another decent trade website)
http://scrap.tf/ (Here, you can trade with bots, however, do note that the prices the bots buy at are not always the best)
http://stats.tf/ (Shows every single stat on tf2, meaning it shows how many of each item exists. You can also find if items are duplicated here)
http://wiki.teamfortress.com/wiki/Main_Page  (The best page of Tf2 for knowing what an item does and its history)

http://steamrep.com/

http://steamidfinder.com/

*not done yet

Baby steps (Quadratic Formula)

Ok, so I just made this really simple quadratics program. At least you don’t need to type in all those numbers anymore. You can just use this.

Program: QUADFORM

:Prompt A,B,C
:(-B+√(B^2-4AC))/(2A)→D                                                                                                       
:(-B-√(B^2-4AC))/(2A)→E                                                                                                        
:Disp D,E

 

Just Joined!

Alright, so I’ll be posting some basic T-84 programs that you can use in your math class. It’ll be related to quadratics, unit circles, etc.

 

Be ready to see some “action”! (hopefully)